Submodule support: tracking, checkout, commit, and recursive operations
- Lingua principale
- Go
- Stelle
- 762
- Fork
- 72
- Merge medio
- 18h 24m
- PR unite (30g)
- 28
Descrizione
## Problem
git-spice has no awareness of Git submodules. Stacks that change a
submodule pointer can't track which submodule branch a parent commit
expects, there is no help checking out or committing the right
submodule state, and recursive operations across a superproject and its
submodules aren't supported. There is also a latent bug: inside a
submodule with an absorbed gitdir, git-spice mis-resolves the worktree
path and treats every branch as "checked out in another worktree,"
breaking restack and sync.
## Proposal
Add submodule support, layered from a tracking baseline up to recursive
operations:
- **Tracking + commands**: a `Submodules` map on each tracked branch in
the store; git-layer listing from `.gitmodules`, current-branch and
worktree resolution, and pointer updates; a `submodule.Tracker` with
exclusion via `spice.submodule.exclude`; commit-time recording of the
per-submodule branch on the parent; `gs branch submodule list` /
`repoint` commands; and `[path:branch]` annotations in `gs ls`/`ll`.
Also fixes the absorbed-gitdir worktree-path resolution bug.
- **Primitives**: building blocks for transactional checkout and
recursive operations.
- **Auto behaviors**: auto-checkout, branch-create inheritance, and
branch-fold merge for submodules.
- **Commit integration**: auto-commit and gitlink pointer updates on
parent commits.
- **Recursive ops**: `gs repo init --recurse-submodules` and
`--recurse-submodules` for `gs stack restack`.
## Tracked by
- #1178 — tracking commands + absorbed-gitdir worktree fix (baseline)
- #1179 — primitives for transactional checkout and recursive ops
- #1180 — auto-checkout, branch-create inheritance, branch-fold merge
- #1181 — auto-commit and gitlink update on parent commits
- #1182 — `gs repo init --recurse-submodules`
- #1183 — `--recurse-submodules` for `gs stack restack`
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.