[chore] Use main-based worktrees (#24) - #25
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Fixes #24
Summary
pnpm branchto create a dedicated worktree under.worktrees/<issue>-<slug>.origin/mainwithout switching the canonical checkout.AS-IS
The branch CLI derives a new branch from whichever checkout is active and switches that checkout in place. A stale task checkout can therefore become the accidental base for new work and for reading repository instructions.
flowchart LR current_checkout[Current checkout] --> branch_command[pnpm branch] branch_command --> current_branch[Create branch from current branch] current_branch --> switch_checkout[Switch canonical checkout in place]pnpm branchrunsgit switch -cin the active checkout.mainreference.TO-BE
The primary checkout remains a synchronized
mainreference, and every task is implemented from an isolated worktree created fromorigin/main.flowchart LR main_checkout[Canonical main checkout] --> sync[git fetch origin main] sync --> branch_command[pnpm branch] branch_command --> origin_main[origin/main] origin_main --> task_worktree[.worktrees/issue-slug] task_worktree --> implementation[Implementation and verification]pnpm branch <type> <issue-number> <slug>creates the branch and worktree without switching the canonical checkout.origin/main, while unrelated dirty changes remain untouched.mainand use the new command for subsequent Issues.Verification
pnpm verifynode --test scripts/new-branch.test.mjs scripts/issue-type.test.mjs scripts/cleanup-merged.test.mjsgit diff --checkCommands completed successfully.
pnpm verifypassed repository tests, lint, typecheck, and builds.User impact
pnpm branchwith the same arguments, but it no longer switches the current checkout; users should work from the printed worktree path.Metadata checklist
Fixes #24references the branch's Issue.Task.Context OS WorkProject withPriority: Medium.Screenshots recordings
Not applicable; this changes repository workflow and documentation only.