diff --git a/.claude/agent-notes.md b/.claude/agent-notes.md index 79b1027..e7fd2f5 100644 --- a/.claude/agent-notes.md +++ b/.claude/agent-notes.md @@ -16,3 +16,4 @@ update or remove the stale line rather than leaving both. - User-facing docs (README, CHANGELOG) must not mention features that never shipped; 1.0.0 is the first release, so there is no prior version to reference. - CHANGELOG follows GitHub release-notes format (`## What's Changed` + PR URLs), listing shipped features only — not Keep a Changelog / Unreleased / pre-1.0 fix archaeology. PR URLs remain even after the git history wipe. - Do not mention previous code, removed subcommands, or pre-v1.0 archaeology anywhere in the tree (docs, comments, tests). Forward-looking constraints and current git-behavior rationale are fine; unused merged-branch/`rev-list` guidance and a dedicated `clean` unknown-command test are not. +- Do not remove an `init` container on agent-seeding failure; return nonzero and leave the directory. diff --git a/README.md b/README.md index 75c41ca..cd05377 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ does, you could do with `git worktree` by hand. `init` and `add` produce different things — the container first, working copies after: -``` +```text After `git trees init`: After `git trees add feature-x`: some-repo/ some-repo/ @@ -120,6 +120,7 @@ cd git-trees && ./install.sh # → ~/.local/bin **Convenience — one-line curl.** Fetches only the script: ```bash +mkdir -p ~/.local/bin curl -o ~/.local/bin/git-trees \ https://raw.githubusercontent.com/brightdigit/git-trees/v1.0.0/git-trees chmod +x ~/.local/bin/git-trees @@ -145,17 +146,6 @@ case ":$PATH:" in *":$HOME/.local/bin:"*) ;; *) `install.sh` warns if it isn't; the curl path cannot. Anything on `PATH` named `git-trees` becomes `git trees`. -### Uninstall - -```bash -./install.sh --uninstall # clears ~/.local/bin and /usr/local/bin -./install.sh --uninstall /opt/bin # or the prefix you installed to -``` - -Pass the same directory you installed to — without it, a custom-prefix install is -left behind. Uninstall does **not** remove `~/.config/git-trees/AGENTS.md`; it -says so, and you can delete it yourself. - ## Configuration All three variables are optional. Add to `~/.zshrc` (or `~/.bashrc`): @@ -220,8 +210,8 @@ Creates a worktree, handling three cases: | Branch exists on `origin` | Fetch, create with `--track` | | Branch is new | Create from `base` (default `origin/`) with `--no-track` | -> **`add` writes to the remote.** Upstream is always set afterward via `track`. -> If the branch does not exist on `origin`, that runs +> **`add` writes to the remote by default.** When pushing is enabled, upstream is +> set afterward via `track`. If the branch does not exist on `origin`, that runs > `git push -u origin HEAD` — **which creates the branch on the remote.** This > is a reasonable default for parallel coding agents, which need an upstream to > push to, but it means a local-feeling command fires CI, sends notifications, diff --git a/install.sh b/install.sh index f1bdd27..8f13374 100755 --- a/install.sh +++ b/install.sh @@ -3,44 +3,12 @@ # # ./install.sh install to ~/.local/bin # ./install.sh /usr/local/bin install elsewhere -# ./install.sh --uninstall remove from the two default locations -# ./install.sh --uninstall /opt/bin remove from the prefix you installed to set -uo pipefail SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CFG="$HOME/.config/git-trees" -if [ "${1:-}" = "--uninstall" ]; then - # Honor the same DEST as install. Without an argument, sweep the two defaults; - # a custom-prefix install would otherwise be left behind silently. - if [ -n "${2:-}" ]; then - set -- "$2" - else - set -- "$HOME/.local/bin" /usr/local/bin - fi - - removed=0 - for d in "$@"; do - if [ -e "$d/git-trees" ]; then - if rm -f "$d/git-trees"; then - echo "removed $d/git-trees" - removed=1 - fi - fi - done - - if [ "$removed" -eq 0 ]; then - echo "install.sh: no git-trees found in $*" >&2 - echo " if you installed elsewhere, pass it: ./install.sh --uninstall " >&2 - fi - - if [ -e "$CFG/AGENTS.md" ]; then - echo "left $CFG/AGENTS.md in place — remove it yourself if you want it gone" - fi - exit 0 -fi - DEST="${1:-$HOME/.local/bin}" [ -f "$SRC/git-trees" ] || { echo "install.sh: git-trees not found in $SRC" >&2; exit 1; } diff --git a/tests/smoke.sh b/tests/smoke.sh index e8d73c2..a84de23 100755 --- a/tests/smoke.sh +++ b/tests/smoke.sh @@ -91,8 +91,12 @@ assert_no_hang() { # assert_no_hang