Docs: a quickstart that works, a concepts primer, and honest install docs#38
Conversation
**#20 — the quickstart left a new user where git doesn't work.** It said `init` then `cd`, but there is no worktree until `add` runs, so the next git command fails with `fatal: this operation must be run in a work tree`. To a novice that reads as "this tool broke my git". The quickstart now includes the first worktree (`git trees add main`, `cd main`) and states that the container root having no files checked out is expected. The layout diagram, which was captioned "`git trees init` produces:" while showing a `<branch-name>/` directory that only `add` creates, is split into before and after. **#24 — "Requires bash 4+" was wrong.** The script uses no bash-4-only features. Replaced with an accurate statement: Bash, not POSIX sh, and macOS's built-in /bin/bash 3.2 is fine. Verified by running the commands under 3.2, not just `bash -n`. A Prerequisites section above Install now covers git, bash, network, and forge credentials. **#26 — nothing anchored a reader who has never used `git worktree`.** Added a Concepts section defining worktree, bare store, container, gitdir pointer, and upstream. `AGENTS.md.template` told agents not to `git checkout` without saying what to do instead; it now names `git trees add <name>`. This repo's `AGENTS.md` now says outright that it is contributor guidance and that the template is a product artifact for a different audience. **#29 — install was underspecified and uninstall was broken for custom prefixes.** `./install.sh <dir>` installed anywhere but `--uninstall` only ever looked in ~/.local/bin and /usr/local/bin, so a custom-prefix install could not be undone by the tool that created it, and said nothing. It now takes the same destination: `./install.sh --uninstall [dir]`, warning when it finds nothing. It also reports that it leaves ~/.config/git-trees/AGENTS.md behind. The README documents clone + install.sh as the full install, notes that curl skips the agents template and tracks a moving `main`, and adds the PATH step. Closes #20, closes #24, closes #26, closes #29. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| ## Concepts | ||
|
|
||
| New to `git worktree`? Five terms cover everything below. |
There was a problem hiding this comment.
Add a GitHub issue to link to a new article about working with work trees
|
Filed as #41 — it covers why several checkouts beat stash-and-switch, the shared-object-store cost model, what bare+worktrees buys over cloning twice, and the two failure modes that confuse people first (the container root where |
Merge order: 4 of 6, into
v1.0.0-integration. Expect a README quickstartconflict with #35 and an Install-section conflict with the release PR.
Closes #20, closes #24, closes #26, closes #29.
Four documentation issues grouped because all four edit
README.md, three ofthem within ~15 lines of each other.
#20 — the quickstart left a new user where git doesn't work
initthencdlands you in a directory with no worktree, so the next gitcommand fails with
fatal: this operation must be run in a work tree. To anovice that reads as "this tool broke my git". Compounding it, the layout diagram
was captioned "
git trees initproduces:" while showing a<branch-name>/directory that only
addever creates.The quickstart now includes the first worktree and says the intermediate state is
expected. The diagram is split into after-
initand after-add.#24 — "Requires bash 4+" was wrong
No bash-4-only features are used, and the shebang is
#!/usr/bin/env bash, so onmacOS this usually resolves to
/bin/bash3.2 — meaning the stated requirementwas both wrong and wrong about the most likely platform. Replaced with an
accurate statement, plus a Prerequisites section covering git, bash, network
for
init, and forge credentials.#26 — no anchor for a reader new to
git worktreeAdded a Concepts section defining worktree, bare store, container, gitdir
pointer, and upstream.
AGENTS.md.templatesaid not togit checkoutwithoutsaying what to do instead — it now names
git trees add <name>. This repo'sAGENTS.mdnow states that it is contributor guidance and that the template is aproduct artifact for a different audience.
The fourth item in #26 — "
--older-thanreads as age-only" — is void: #35removes
clean.#29 — install underspecified, uninstall broken for custom prefixes
./install.sh <dir>installs anywhere, but--uninstallonly ever looked in~/.local/binand/usr/local/bin. A custom-prefix install could not be undoneby the tool that created it, and nothing said so. Now
./install.sh --uninstall [dir]takes the same destination, warns when it findsnothing, and reports that it leaves
~/.config/git-trees/AGENTS.mdbehind.The README now documents clone +
install.shas the full install, states thatcurl skips the agents template (so the documented
TREES_AGENTS_TEMPLATEdefaultpoints at a file you don't have) and tracks a moving
main, and adds thePATHstep the curl path can't warn about.
The curl URL still points at
mainhere — the release PR pins it to the tag, sothe README doesn't 404 in the window before
v1.0.0exists.Verified
bash 3.2 claim, at runtime — not just
bash -n. UnderGNU bash 3.2.57(1)-release:help,root,add feature-x,add brandnew,add --print-path,track,list,list --json,clean, and theoutside-a-repo error all behave correctly. Upstreams came out
origin/feature-xand
origin/brandnew— bothAGENTS.mdregressions hold on 3.2.The quickstart, followed literally. After
init: exactly.git,AGENTS.md,trees-bare.git— the diagram matches disk.git statusthereprints
fatal: this operation must be run in a work tree, as the new text says.After
git trees add main && cd main,git statussucceeds(
## main...origin/main).add feature-xthen produces the sibling directory.install.sh, against a redirected
HOMEso no real install was touched:--uninstallwith no dir, custom install present--uninstall <same dir>--uninstall~/.config/git-trees/AGENTS.mdshellcheck -s bash git-trees install.shclean.🤖 Generated with Claude Code