chore(worktree): put worktrees under .claude and carry the overrides into them - #124
Conversation
…into them Worktrees were opened beside the checkout as `magic_starter-<slug>`, which put them in the workspace directory next to the real repositories and left Claude Code's own `EnterWorktree` unusable, since that tool writes to a fixed `.claude/worktrees/<slug>`. The move exposes a second problem that the old layout hid. `pubspec_overrides.yaml` is gitignored, so a worktree never receives it, and its absence is silent: the siblings resolve from pub.dev, `flutter pub get` succeeds, and the suite then passes against the PUBLISHED packages while the diff under review is of the local ones. `.worktreeinclude` is what copies the file in. For that copy to be correct the local file needs absolute paths, because a relative `../magic` resolves to `.claude/worktrees/magic` from inside a worktree. That file is machine-local and not committed, so this commit cannot carry it; the note lives in `.worktreeinclude`. CI is unaffected: it writes its own copy with relative paths, which is right there because it clones the siblings beside the checkout.
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. Two config-only files, both correct: the ignore rule scopes to Minor
Notes on the claims, all of which check out
TestsNo test covers this and none could: both files are consumed by git and by the harness, not by the package. No Dart changed. Checks I ran
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks, the four verification notes all match what I measured. The
Measured on this branch rather than reasoned about: The listing is 560 lines and contains no dotfile at all, not even Same reasoning applies to the Merging. |
…into them (#145) * chore(worktree): put worktrees under .claude and carry the overrides 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. * docs(worktree): record that git clean now reaches a live worktree * docs(worktree): put the absolute-path requirement in Key Gotchas * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
…into them (#40) * chore(worktree): put worktrees under .claude and carry the overrides 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. * docs(worktree): record the session-ownership guard this layout retires * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
…into them (#29) * chore(worktree): put worktrees under .claude and carry the overrides 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. * docs(worktree): stop claiming there is no overrides file, and pin it to absolute paths * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
…into them (#18) * chore(worktree): put worktrees under .claude and carry the overrides 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. * docs(worktree): correct the .claude claim and record the git clean reach * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
…into them (#16) * chore(worktree): put worktrees under .claude and carry the overrides 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. * docs(worktree): record that git clean now reaches a live worktree * docs(worktree): put the absolute-path requirement in Key Gotchas * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
…into them (#24) * chore(worktree): put worktrees under .claude and carry the overrides 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. * docs(worktree): record that git clean now reaches a live worktree * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
…into them (#18) * chore(worktree): put worktrees under .claude and carry the overrides 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. * docs(worktree): record that git clean now reaches a live worktree * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
…into them (#11) * chore(worktree): put worktrees under .claude and carry the overrides 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. * fix(worktree): copy pubspec_overrides.yaml in bin/check, not only on the Claude Code path * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
) * chore(worktree): keep Claude Code worktrees out of the working tree 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. * docs(worktree): record that git clean now reaches a live worktree * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
* chore(worktree): keep Claude Code worktrees out of the working tree 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. * docs(worktree): record that git clean now reaches a live worktree * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
* chore(worktree): keep Claude Code worktrees out of the working tree 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. * docs(worktree): correct the .claude claim and record the git clean reach * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
) * chore(worktree): keep Claude Code worktrees out of the working tree Worktrees used to sit beside the checkout as <repo>-<slug>, which left EnterWorktree unusable since that tool writes to a fixed .claude/worktrees/<slug>. Pattern proven on fluttersdk/magic_starter#124. * docs(worktree): record that git clean now reaches a live worktree * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
…into them (#194) * chore(worktree): put worktrees under .claude and carry the overrides 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. * docs(worktree): record that git clean now reaches a live worktree * fix(worktree): git clean -xdf skips a worktree, only -xdff does not 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.
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
magic_starter-<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.CI is unaffected. It writes its own
pubspec_overrides.yamlwith relative paths, which is correct there, because thesiblingsjob clones the six repositories beside the checkout.Testing
Ran locally on this branch:
pubspec_overrides.yamlto absolute paths,flutter pub getin the main checkout: resolved.git worktree add .claude/worktrees/probe: confirmedpubspec_overrides.yamlis absent there, which is the failure this PR is about..worktreeincludeautomates) and ranflutter pub getin the worktree: resolved, andpackage_config.jsonpoints at the local checkouts:git statusin the main checkout shows no trace of the worktree, so the ignore rule works.Probe worktree and its branch removed afterwards.