rebase discards a still-valid recorded base after the parent's history is edited, replaying the parent's old commits
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- git, go
調査の方向性
ペイロードには実装ファイルもテストも記載されていません。gh stack rebase のエントリーポイントから始め、amended-parent ケースを再現し、その後、記録されたベースが受け入れられるか破棄されるかを追跡します。完了条件は、parent または trunk の履歴が編集された後に B が B1 のみを再適用すること(サイレントな破損のバリエーションを含む)と、両方のケースのリグレッションカバレッジがあることです。
索引モデルが issue の本文から書いたものです。
説明
(This issue was AI generated but I have reviewed it, understood it, and I'm accountable for its content.)
Version: gh-stack v0.1.0.
Setup: trunk main; stack A ← B (gh stack init A B); A has commit A1 modifying f.txt, B has commit B1 adding g.txt.
Repro: amend A1 on A (change f.txt, keep the message), then gh stack rebase.
Expected: B is rebased by replaying only B1 onto the amended A — B's recorded base (old A tip) is still an ancestor of B and delimits exactly B's own commits.
Actual: the recorded base is discarded (apparently because it is no longer in A's history), the boundary falls back to merge-base(A, B) — below the amendment — and the old A1 is replayed onto the amended A: a bogus conflict in f.txt.
Worse variant (silent corruption): if the amendment only removes part of A1 (e.g. A1 touched f.txt + extra.txt, and the amend drops the extra.txt change), the old A1 replays cleanly: B ends up with a duplicated commit and the removed extra.txt resurrected — reported as success.
Suggested fix: accept a recorded base as the --onto boundary whenever it is an ancestor of the branch being rebased; membership in the parent's current history should not be required. This matches Graphite's restack semantics and is what makes stacks robust under history editing.
The same failure triggers when the trunk's history is edited (e.g. a commit below the stack is amended via fixup): the whole old trunk segment is replayed into the bottom stack branch.
- 主要言語
- Go
- スター
- 1.5k
- フォーク
- 73
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/gh-stack のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
feature request topic: cli - general
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
feature request topic: auto-merge
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug topic: docs
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
github/gh-stack の issue をすべて見る
似ている issue
-
feature-request helm
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
gravitational/teleport#69785 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
crossplane/crossplane#7859 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100