chore: ignore nested worktrees - #71
Conversation
Worktrees live inside the repo by org convention. They are separate checkouts, not repo content, and `git add -A` stages them as embedded repositories, which then reach a PR as bare gitlink entries. Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
There was a problem hiding this comment.
This adds a one-line .gitignore entry for worktrees/ to stop nested git worktrees from being staged as embedded repositories under git add -A. The mechanics are correct and the change is safe, but the 3-line comment above it is disproportionate to a single ignore pattern and asserts an 'org convention' that isn't documented anywhere else in this repo.
Automated first pass by seabbs-review-bot (Claude sonnet), triggered by: first pass. Not a human review. Comment @seabbs-review-bot to ask for another pass: @seabbs any time, the author's agent once it has pushed changes. Add the no-review label to opt this PR out. Ping @seabbs with any questions.
| @@ -0,0 +1,4 @@ | |||
| # Nested git worktrees, by the org convention of keeping them inside the | |||
There was a problem hiding this comment.
suggestion This cites 'the org convention of keeping them inside the repo rather than beside it' as established fact, but no other file in this repo (CONTRIBUTING.md, README, workflows) mentions such a convention. Either link to where it's actually defined, or trim this to a plain one-liner, e.g. # Ignore nested git worktrees (avoid staging them as embedded repos).
.gitignorewas empty andworktrees/was untracked, sogit add -Afrom the repo root stages six nested checkouts as embedded repositories.This is not hypothetical — it bit twice today. Once caught before pushing (three worktrees staged as gitlinks in a workflow-only commit), and once not caught until after, which took a force-push to unpick.
An embedded-repo entry is easy to miss in review: it shows as a single line in
--stat, with no diff body.The org convention puts worktrees inside the repo rather than beside it, so this will keep happening otherwise.
This was opened by a bot. Please ping @seabbs for any questions.