feat(submodule): track and manage submodule branch associations#1178
Draft
ed-irl wants to merge 4 commits into
Draft
feat(submodule): track and manage submodule branch associations#1178ed-irl wants to merge 4 commits into
ed-irl wants to merge 4 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
Draft
44671b8 to
dfe2d2f
Compare
16e21bf to
217bc45
Compare
100dd73 to
355164e
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.
355164e to
473b7dd
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.
Record which branch each submodule is on when a parent commit is made, and surface those associations in the branch log and through new management commands.
New commands:
gs branch submodule listshows the submodule branch associations recorded for a branch (defaults to the current branch).gs branch submodule repoint <path>changes the submodule branch associated with the current parent branch, defaulting to the submodule's current branch.Automatic tracking:
branch create,commit create, andcommit amendrecord each non-excluded submodule's current branch via a new SubmoduleTracker. Detached-HEAD submodules are skipped, and recording failures only warn.spice.submodule.excludelists submodule paths to skip.Display:
gs lsandgs llrender associations as[path:branch]; the JSON log adds asubmodulesfield.State:
submodulesmap. UpsertRequest.Submodules merges into existing state: non-empty values set an entry, empty strings remove one, and nil leaves it unchanged.Git layer:
%(worktreepath)as the gitdir; previously this caused restacks inside a submodule to be skipped as "checked out in another worktree".