gh stack rebase --continue doesn't report new conflicts hit while resuming a multi-commit branch rebase
まだ誰も着手していません。
評価
調査の方向性
cmd/rebase.go の continueRebase から始め、その進行中のパスを printConflictDetailsWithContinue と比較します。次に internal/git/gitops.go の git.RebaseContinue と internal/git/git.go の tryAutoResolveRebase を追跡し、gh stack rebase --continue で複数コミットにまたがる競合フローを再現します。後続の競合で、汎用エラーだけでなく現在の Conflicted files ブロックが報告されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
gh stack rebase --continue only prints Conflicted files: listing for first conflict encountered when cascading one stacked branch onto another. If resolving that conflict and continuing causes git to hit a second conflict on a later commit within the same branch's replay, the tool does not report what files are now conflicted and just returns a generic wrapped error.
This can make it look like there's only one conflicted file when there are actually more. You can only see the other conflicts by manually running git status.
Steps to reproduce
- Create a stack with a branch containing at least two commits and at least two files, where:
- Commit A modifies
file1.txtso that there's a conflict with the (rebased) parent branch. - Commit B later modifies
file2.txtso that it also conflicts with the parent branch, independently of commit A.
- Commit A modifies
- Rebase the stack
- The tool stops on commit A's conflict and correctly prints:
Conflicted files: C file1.tsx (lines N–M) - Resolve
file1.txt, stage it, rungh stack rebase --continueagain. - Git internally applies commit B next, which conflicts on
file2.txt.
Expected behavior
Step 5 should print the same kind of Conflicted files: block, listing file2.txt with its conflict line numbers, like step 3 did for file1.txt.
Actual behavior
Step 5 prints a generic error:
rebase continue failed — resolve remaining conflicts and try again: exit status 1
No indication of which file(s) are now conflicted. The only way to discover where the new conflict is is running git status manually.
Proposed solution / notes
I'll be honest, not familiar with Go so this "solution" is mostly Claude. I did double check that it looks at least mostly right to me. Figured it might be helpful.
Traced this to
cmd/rebase.goandinternal/git/git.go:
printConflictDetails()/printConflictDetailsWithContinue()(cmd/rebase.go:545) is the function that formats theConflicted files:block with per-file conflict-marker line numbers (viagit.FindConflictMarkers). It's only called from the branch-to-branch cascade logic, atcmd/rebase.go:259and:435.continueRebase()(cmd/rebase.go:312) has a separate path for resuming an already in-progressgit rebasewithin a single branch's multi-commit replay:This path never callsif git.IsRebaseInProgress() { rebaseOpts := git.RebaseOpts{CommitterDateIsAuthorDate: state.CommitterDateIsAuthorDate} if err := git.RebaseContinue(rebaseOpts); err != nil { return fmt.Errorf("rebase continue failed — resolve remaining conflicts and try again: %w", err) } }printConflictDetails.- Following
RebaseContinue(internal/git/gitops.go:334) intotryAutoResolveRebase(internal/git/git.go:118), the conflicted-files list is actually fetched — just to check whetherrererealready auto-resolved everything — and then discarded on the way out:conflicts, err := ConflictedFiles() if err != nil { return originalErr } if len(conflicts) > 0 { return originalErr // <-- conflicts is right here and gets thrown away }Fix: in
continueRebase, whengit.RebaseContinuereturns an error, callprintConflictDetailsWithContinue(using the still-in-progress rebase's current conflicted files, e.g. by callinggit.ConflictedFiles()again, or by threadingtryAutoResolveRebase's localconflictsslice out through the error) before returning, instead of just wrapping the raw error string. That gives resume-mid-branch conflicts the same reporting as cascade-boundary conflicts.
Environment
ghversion: 2.97.0 (2026-07-31)gh-stackextension:github/gh-stackv0.1.0- OS: macOS Tahoe 26.5.1
- 主要言語
- Go
- スター
- 1.5k
- フォーク
- 73
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/gh-stack のほかの issue
-
難易度 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
-
feature request topic: cli - view
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/gh-stack の issue をすべて見る
似ている issue
-
kind/bug needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
matrixorigin/matrixone#29223 ·
-
needs-acceptance wg/data-plane-networking
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vllm-project/semantic-router#4024 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
alexgorbatchev/dotfiles#107 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100