feat(worktree): add worktree management commands and per-worktree trunks#1170
Open
ed-irl wants to merge 2 commits into
Open
feat(worktree): add worktree management commands and per-worktree trunks#1170ed-irl wants to merge 2 commits into
ed-irl wants to merge 2 commits into
Conversation
Collaborator
Author
|
This change is part of the following stack: Change managed by git-spice. |
This was referenced May 18, 2026
1ad5a37 to
f63a0de
Compare
4 tasks
f63a0de to
e02ef88
Compare
e02ef88 to
aff35c2
Compare
aff35c2 to
f1ce6f6
Compare
f1ce6f6 to
96b120c
Compare
db800b9 to
378e4e4
Compare
378e4e4 to
1b093b5
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.
Adds
gs worktree createandgs worktree list, plus worktree-aware filtering across the log and restack commands.Per-worktree trunks
gs worktree create <path>sets up a new worktree with its own local trunk branch (named after the directory, or via--trunk) that tracks the same remote ref as the canonical trunk. Stacks created in a worktree base on this branch, sogs repo syncand restacks in different worktrees no longer contend on a single shared trunk checkout.-b/--branchalso creates a tracked branch stacked on the worktree trunk;--no-trunkkeeps the legacy detached-HEAD behavior.The registry lives in a new, additive
worktree-trunksstate key — older binaries and pre-existing repos simply see no entry.Store.IsTrunk/TrunkFortreat registered worktree trunks as trunk-equivalents, andBranchGraphtraversals (Bottom,Downstack, etc.) now stop at any trunk, not just the canonical one.Worktree-scoped filtering
-w/--worktreeonlog short/log longandrepo restacklimits output to stacks with a branch checked out in the current worktree, via the newBranchGraph.StacksInWorktree.repo restackgains an internalSkipCheckoutso it can filter without forcing a checkout.Test plan
worktree create/list,log short -wandrepo restack -wfiltering, branch create/restack when trunk lives in another worktreemise run generatefor help/docs