Skip to content

feat(submodule): add git-layer primitives and transactional/recursive handlers#1179

Draft
ed-irl wants to merge 2 commits into
ed-irl/submodule-trackingfrom
ed-irl/submodule-status
Draft

feat(submodule): add git-layer primitives and transactional/recursive handlers#1179
ed-irl wants to merge 2 commits into
ed-irl/submodule-trackingfrom
ed-irl/submodule-status

Conversation

@ed-irl

@ed-irl ed-irl commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Introduce the building blocks for submodule-aware git-spice operations: low-level git inspection/snapshot helpers and a new internal/handler/submodule package coordinating them.

  • git: add submodule inspection helpers on WorktreeSubmoduleStatus (branch/detached, HEAD hash, parent gitlink hash, and whether the sub has a gs store), plus the underlying SubmoduleHead, SubmoduleGitlink, and SubmoduleHasGsStore.
  • git: add HeadSnapshot with SnapshotHead/RestoreHead to capture and restore a worktree's HEAD (branch or detached), used to make multi-sub operations reversible.
  • handler/submodule (Applier): ApplyAssociations switches 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 an Exclude list and treats unrecorded/untracked branches as no-ops.
  • handler/submodule (recurse): OpenContext builds the per-submodule git-spice plumbing (worktree, repo, store, service) rooted at a sub, returning ErrSubmoduleNotInitialized when the sub lacks a gs store; ForEachInitializedSubmodule iterates .gitmodules, soft-skipping excluded and uninitialized subs.
  • handler/submodule (errors): DivergedFromRecordError and FoldConflictError, each rendering copy-pasteable remediation hints.
  • git tests: replace inline filepath.ToSlash(filepath.Join(...)) with a joinSlash helper.

Part of #1246

@ed-irl ed-irl force-pushed the ed-irl/submodule-tracking branch from bfbf58d to 75be3df Compare June 2, 2026 18:57
@ed-irl ed-irl force-pushed the ed-irl/submodule-status branch 2 times, most recently from fa53913 to c3aa212 Compare June 2, 2026 20:16
@ed-irl ed-irl force-pushed the ed-irl/submodule-tracking branch from c99064b to 44671b8 Compare June 2, 2026 22:31
@ed-irl ed-irl force-pushed the ed-irl/submodule-status branch from c3aa212 to 6d52edc Compare June 2, 2026 22:34
@ed-irl ed-irl force-pushed the ed-irl/submodule-tracking branch from 44671b8 to dfe2d2f Compare June 8, 2026 10:18
@ed-irl ed-irl force-pushed the ed-irl/submodule-status branch from 6d52edc to 0e22ba0 Compare June 8, 2026 10:18
@ed-irl ed-irl force-pushed the ed-irl/submodule-tracking branch from dfe2d2f to c6936dd Compare June 12, 2026 20:05
@ed-irl ed-irl force-pushed the ed-irl/submodule-status branch from 0e22ba0 to ff86ca6 Compare June 12, 2026 20:05
@ed-irl ed-irl force-pushed the ed-irl/submodule-tracking branch from c6936dd to 16e21bf Compare June 13, 2026 13:38
@ed-irl ed-irl force-pushed the ed-irl/submodule-status branch from ff86ca6 to e33206f Compare June 13, 2026 13:38
@ed-irl ed-irl force-pushed the ed-irl/submodule-tracking branch from 16e21bf to 217bc45 Compare June 15, 2026 09:51
@ed-irl ed-irl force-pushed the ed-irl/submodule-status branch from e33206f to 236db03 Compare June 15, 2026 09:52
@ed-irl ed-irl force-pushed the ed-irl/submodule-tracking branch from 100dd73 to 355164e Compare June 19, 2026 00:58
@ed-irl ed-irl changed the title submodule: add primitives for transactional checkout and recursive ops feat: add worktree management commands, per-worktree trunks, and worktree-aware filtering Jun 19, 2026
@ed-irl ed-irl force-pushed the ed-irl/submodule-status branch from 8389d82 to f843ca7 Compare June 19, 2026 00:59
@ed-irl ed-irl changed the title feat: add worktree management commands, per-worktree trunks, and worktree-aware filtering feat(submodule): add git-layer primitives and transactional/recursive handlers Jun 19, 2026
@ed-irl ed-irl force-pushed the ed-irl/submodule-tracking branch from 355164e to 473b7dd Compare June 24, 2026 01:31
@ed-irl ed-irl force-pushed the ed-irl/submodule-status branch from f843ca7 to a3150c5 Compare June 24, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant