submodule: associations follow checkout, inherit on create, merge on fold#1180
Draft
ed-irl wants to merge 4 commits into
Draft
submodule: associations follow checkout, inherit on create, merge on fold#1180ed-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
32667fc to
0ee783f
Compare
c35f125 to
a53813b
Compare
6d52edc to
0e22ba0
Compare
a53813b to
056942f
Compare
0e22ba0 to
ff86ca6
Compare
829f703 to
f6111a2
Compare
ff86ca6 to
e33206f
Compare
f6111a2 to
11fbf07
Compare
e33206f to
236db03
Compare
11fbf07 to
faefa69
Compare
8389d82 to
f843ca7
Compare
1568077 to
074df48
Compare
Hook the submodule.Applier into the checkout flow so tracked submodules follow the parent's recorded sub-branch when the user runs gs bco / gs down / gs up / gs trunk / gs branch onto. Highlights: - checkout.Handler: snapshot parent HEAD before checkout; apply recorded submodule associations after; restore parent on submodule failure. - branch_onto.go: applies the same snapshot/apply/rollback pattern directly (does not route through checkout.Handler because its VerifyRestacked path is not appropriate post-BranchOnto). - branch_create.go: now records inherited submodule associations from the parent branch and overlays the current sub state. - branch_fold.go: merges submodule associations from the folded branch into the base. Same path/same value: kept. Disjoint: combined. Both set but differ: pre-resolved via --module-branch=PATH=BRANCH; otherwise prompted (interactive) or returned as FoldConflictError. - internal/handler/submodule: add Applier.MergeAssociationsForFold and Tracker.RecordWithInheritance. - internal/handler/submodule: rename SubmoduleContext→Context and OpenSubmoduleContext→OpenContext to satisfy revive.
f843ca7 to
a3150c5
Compare
074df48 to
50250cd
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.
Make tracked submodule branch associations move with branch operations transactionally, with HEAD rollback on conflict.
Adds checkout.GitWorktree.SnapshotHead/RestoreHead, a checkout SubmoduleApplier interface, and unit + test-script coverage for inheritance, checkout apply, and fold merge.
Part of #1246