feat(worktree): add worktree commands, per-worktree trunks, and worktree-aware filtering#1182
Draft
ed-irl wants to merge 3 commits into
Draft
feat(worktree): add worktree commands, per-worktree trunks, and worktree-aware filtering#1182ed-irl wants to merge 3 commits into
ed-irl wants to merge 3 commits into
Conversation
Collaborator
Author
|
This change is part of the following stack:
Change managed by git-spice. |
This was referenced May 19, 2026
Draft
b2e2972 to
7020d10
Compare
7cbf48b to
66cca89
Compare
73b4f4c to
e6f5a36
Compare
66cca89 to
39a8932
Compare
e6f5a36 to
3a64ff4
Compare
39a8932 to
2671243
Compare
3a64ff4 to
b96e1f7
Compare
2671243 to
763265d
Compare
b96e1f7 to
e5977f3
Compare
763265d to
fa376a3
Compare
e5977f3 to
8d5549e
Compare
fa376a3 to
df5a62e
Compare
15ae428 to
a9d8ed3
Compare
ed78147 to
ca8ae7b
Compare
7ad0991 to
454f625
Compare
7246c35 to
4f82ef2
Compare
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.
Add
gs worktree createandgs worktree list.worktree createsets up a per-worktree trunk: a local branch (namedafter the worktree directory, or set with --trunk) that tracks the same
remote ref as the canonical trunk. Stacks created in the worktree are
based on this branch, so
repo syncand restacks in different worktreesnever contend on a single shared trunk checkout. Use -b to also create a
tracked branch on the worktree trunk, or --no-trunk for the legacy
detached-HEAD behavior.
The state store gains a per-worktree trunk registry (an additive,
optional key, so older repos and binaries are unaffected). Trunks are
resolved per-worktree via TrunkFor, and IsTrunk now treats every
registered worktree trunk as a graph root: traversals and the branch
graph stop at them, and they may not themselves be tracked or deleted.
Add
-w/--worktreetolog shortandrepo restackto scope outputand restacking to stacks with a branch checked out in the current
worktree, via BranchGraph.StacksInWorktree. The sync handler now
distinguishes the canonical remote trunk from the local worktree trunk
it pulls into, and restack gains WorktreeFilter and SkipCheckout.