chore(worktree): put worktrees under .claude and carry the overrides into them - #145
Conversation
…into them 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.
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. Looks correct - a two-file, config-only change whose three load-bearing claims I checked directly, and all three hold. What I confirmed rather than assumed:
Putting worktrees under a dot-directory is also the safer of the two layouts for the same reason: Minor
TestsNothing covers this, and nothing can: the behaviour belongs to Claude Code's worktree creation, not to this package. The description's manual end-to-end verification is the appropriate substitute. No file under Checks I ran
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Fixed. You were right that It is now a row in Key Gotchas, which is where this repository already keeps "the thing that will bite you and the fix", rather than a new section. The failure mode you noted stays the reason it is only a Minor: a stale relative path breaks version solving loudly instead of resolving from pub.dev silently. Also from another review in this sweep: |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. Since my last review the two new commits are documentation only - the The absolute-path requirement is now in Minor
The
TestsUnchanged from my last review: nothing covers this and nothing can, since the behaviour belongs to Claude Code's worktree creation. No file under Checks I ran
|
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. Nothing new to raise - the only commit since my last review is the What changed since last time: The two TestsUnchanged: nothing covers this and nothing can, since the behaviour belongs to Claude Code's worktree creation. No file under 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.
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. Both of my outstanding Minors are fixed by the single new commit, and I reproduced every clause of the rewritten comment - nothing left to raise. What changed since last review: I re-ran the same throwaway-repo probe against the new wording, and all four claims hold on git 2.43.0: So "resolves a gitfile too", "the contents survive", " The ignore rule still bites after the comment reflow: TestsUnchanged: nothing covers this and nothing can, since the behaviour belongs to Claude Code's worktree creation. No file under Checks I ran
|
What
.gitignore: ignore.claude/worktrees/(only that subdirectory; the rules under.claude/stay tracked).worktreeinclude: new, copiespubspec_overrides.yamlinto every worktree Claude Code createsWhy
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>.Moving them inside exposes a problem the old layout hid.
pubspec_overrides.yamlis gitignored, so a worktree never receives it, and the absence is silent rather than loud: the siblings resolve from pub.dev,flutter pub getsucceeds, and the suite passes against the PUBLISHED packages while the diff under review is of the local ones. An unreleased sibling API is where that bites.For the copy to be correct the local file needs ABSOLUTE paths, since a relative
../magicresolves to.claude/worktrees/magicfrom inside a worktree. That file is machine-local and not committed, so this PR cannot carry it; the requirement is documented in.worktreeinclude.Testing
The pattern was proven end to end on fluttersdk/magic_starter#124 first: probe worktree opened under the new path,
pubspec_overrides.yamlconfirmed absent, copied in,flutter pub getresolved andpackage_config.jsonpointed at the local checkouts. Here I verified that every rewritten absolute path resolves to a real package directory and thatflutter pub getstill succeeds.No Dart, YAML or
lib/file is touched, so analyze, format and test have nothing to say about this diff.