feat(worktree): Add worktree commands, per-worktree trunks, and worktree filtering#1162
Open
ed-irl wants to merge 2 commits into
Open
feat(worktree): Add worktree commands, per-worktree trunks, and worktree filtering#1162ed-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 14, 2026
Open
c8dd0d1 to
89378af
Compare
This was referenced Jun 2, 2026
Draft
e17e522 to
47eb920
Compare
febcc09 to
8648c7a
Compare
Owner
|
working on merging functionality from this stack next |
8648c7a to
0719a4f
Compare
This was referenced Jun 14, 2026
c8254f9 to
dabcd6f
Compare
abhinav
pushed a commit
that referenced
this pull request
Jun 14, 2026
The comments CLI needs a local representation for inline comments that have been prepared but not submitted to a forge yet. Staged comments now persist the target path, line range, body, diff side, and optional thread identifier in the spice state database. That gives command code a stable state boundary before it batches the comments into a forge review. Extracted from #1162
dabcd6f to
1d76154
Compare
1d76154 to
5e57d40
Compare
Introduces restack.Options{AutoResolve} and threads an opts *Options
parameter through the high-level restack entry points (RestackBranch,
RestackStack, RestackDownstack) and the merge/sync RestackHandler
interfaces, with all current callers passing nil.
This is foundational plumbing for the restack auto-resolve feature.
Landing it on a branch below the consuming stacks lets every branch
inherit the 3-arg signature, rather than the signature change living
on a branch parallel to its callers.
Add inline comment infrastructure across all forges (GitHub, GitLab, Bitbucket, ShamHub) with three optional interfaces: - WithInlineComments: list, post, and batch-submit inline comments - WithThreadResolution: resolve/unresolve review threads - WithCommentEdit: edit existing review comments Refactor Bitbucket and GitLab implementations to use typed gateway client methods (CommentCreate, CommentResolve, MergeRequestDiscussionCreate, etc.) in place of raw HTTP calls, and add reply support for Bitbucket inline comments via the Parent field on CommentCreateRequest. Introduce the diffmap package for mapping working-tree line numbers to diff coordinates, and staged comment storage in the spice state for local comment management before batch submission. Regenerate forge mocks to reflect the updated MergeChange signature and the new inline-comment interfaces.
5e57d40 to
b382179
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 first-class support for working across multiple Git worktrees with independent trunks, so
repo syncand restacks in different worktrees no longer contend on a single shared trunk checkout.Commands
gs worktree create <path>(aliaswtc): creates a worktree with its own local trunk branch that tracks the same remote ref as the canonical trunk.--trunknames it (defaults to the directory name),--no-trunkkeeps the legacy detached-HEAD behavior, and-b/--branchcreates a tracked branch stacked on the worktree trunk.gs worktree list(aliaswtls): lists worktrees with their checked-out branch and stack.Per-worktree trunks
worktree-trunksregistry ininternal/spice/state:WorktreeTrunk,Register/Unregister/WorktreeTrunks,IsTrunk, andTrunkFor(path). The key is additive and optional, so existing repositories and older binaries are unaffected.BranchGraphnow treats every registered worktree trunk as a graph root: downstack/Bottomtraversals stop at any trunk, andStacksInWorktreereturns complete stacks anchored in a given worktree.syncdistinguishes the canonical remote trunk from the local trunk it pulls into for the current worktree; in the primary worktree the two are identical.Worktree-scoped filtering
-w/--worktreeonlog short(implies--all) filters the listing to stacks present in the current worktree and roots them under that worktree's trunk.-w/--worktreeonrepo restacklimits restacking to stacks with a branch in the current worktree.Adds
Repository.WorktreeAdd, regenerated mocks, help/CLI-reference docs, a changelog entry, and unit + script tests covering trunk registry behavior, graph rooting, and the new commands and filters.Part of #1241