rebase discards a still-valid recorded base after the parent's history is edited, replaying the parent's old commits
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- git, go
- Domain
- cli, developer-experience
Research direction
The payload names no implementation files or tests. Start at the gh stack rebase entry point and reproduce the amended-parent case, then trace how the recorded base is accepted or discarded. Done means B replays only B1 after parent or trunk history edits, including the silent-corruption variant, with regression coverage for both cases.
Written by the indexing model from the issue text.
Description
(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.
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 73
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/gh-stack
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
feature request topic: cli - general
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
feature request topic: auto-merge
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug topic: docs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NVIDIA/gpu-operator#2955 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
kovidgoyal/kitty#10516 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
cisagov/vulnrichment#337 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100