abhinav / abhinav/git-spice

Submodule support: tracking, checkout, commit, and recursive operations

オープン
#1,246 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Go
スター
762
フォーク
72
平均マージ
18時間 24分
マージ済み PR(30日)
28

説明

## 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`

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。