feat(submodule): add git-layer primitives and transactional/recursive handlers#1179
Draft
ed-irl wants to merge 2 commits into
Draft
feat(submodule): add git-layer primitives and transactional/recursive handlers#1179ed-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 19, 2026
Draft
bfbf58d to
75be3df
Compare
fa53913 to
c3aa212
Compare
c99064b to
44671b8
Compare
c3aa212 to
6d52edc
Compare
44671b8 to
dfe2d2f
Compare
6d52edc to
0e22ba0
Compare
dfe2d2f to
c6936dd
Compare
0e22ba0 to
ff86ca6
Compare
c6936dd to
16e21bf
Compare
ff86ca6 to
e33206f
Compare
16e21bf to
217bc45
Compare
e33206f to
236db03
Compare
100dd73 to
355164e
Compare
8389d82 to
f843ca7
Compare
355164e to
473b7dd
Compare
f843ca7 to
a3150c5
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.
Introduce the building blocks for submodule-aware git-spice operations: low-level git inspection/snapshot helpers and a new
internal/handler/submodulepackage coordinating them.Worktree—SubmoduleStatus(branch/detached, HEAD hash, parent gitlink hash, and whether the sub has a gs store), plus the underlyingSubmoduleHead,SubmoduleGitlink, andSubmoduleHasGsStore.HeadSnapshotwithSnapshotHead/RestoreHeadto capture and restore a worktree's HEAD (branch or detached), used to make multi-sub operations reversible.ApplyAssociationsswitches each tracked submodule to the branch recorded for a parent branch, in deterministic order, snapshotting each sub's HEAD and rolling back all switched subs on the first failure. Honors anExcludelist and treats unrecorded/untracked branches as no-ops.OpenContextbuilds the per-submodule git-spice plumbing (worktree, repo, store, service) rooted at a sub, returningErrSubmoduleNotInitializedwhen the sub lacks a gs store;ForEachInitializedSubmoduleiterates.gitmodules, soft-skipping excluded and uninitialized subs.DivergedFromRecordErrorandFoldConflictError, each rendering copy-pasteable remediation hints.filepath.ToSlash(filepath.Join(...))with ajoinSlashhelper.Part of #1246