chore(worktree): keep Claude Code worktrees out of the working tree - #9
Conversation
Worktrees used to sit beside the checkout as <repo>-<slug>, which put them in the workspace directory next to the real repositories and left EnterWorktree unusable, since that tool writes to a fixed .claude/worktrees/<slug>. Pattern proven on fluttersdk/magic_starter#124.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. A five-line Minor
TestsConfig-only change with no test surface, which matches the description. Verified behaviourally instead, see below. Checks I ran
|
|
Fixed. Also noted your |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. Since my last review the ignore rule itself is unchanged and still correct; the new commit only rewrites the comment above it, and two things in that new prose are off. The Minor
TestsComment-only change, no test surface. Verified the claim behaviourally instead, below. Checks I ran
|
The comment claimed plain -xdf wipes a live worktree because its .git is a file rather than a directory. Measured on a scratch repo: the dry run prints "Skipping repository .claude/worktrees/slug", the worktree survives -xdf with its untracked files intact, and only -xdff removes it and leaves the registration prunable. The guard keys on the gitlink, not on the form of .git. Also splits the stray # that joined the two comment blocks.
|
You are right and I had it backwards. Reproduced your probe independently before changing anything: So the guard keys on the gitlink, exactly as you said, and my stated reason (that a file-form The stray |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. Both findings from my last review are fixed and the new comment now matches the behaviour I measured; nothing else to raise. Since TestsComment-only change on a config file, so no test surface, as the description says. Checks I ran
|
What
.gitignore: ignore.claude/worktrees/(only that subdirectory; the rules under.claude/stay tracked).Why
Worktrees were opened beside the checkout as
<repo>-<slug>, so they landed in the workspace directory next to the real repositories, and Claude Code'sEnterWorktreecould not be used at all: it writes to a fixed.claude/worktrees/<slug>. With them inside the repository, git has to be told to ignore them.No
.worktreeincludehere, because this repository keeps nopubspec_overrides.yaml; there is nothing gitignored that a worktree would need. Sibling repositories that do carry one get that file too, see fluttersdk/magic_starter#124.Testing
Config only. No Dart, YAML or
lib/file is touched, so analyze, format and test have nothing to say about this diff.