Repository navigation
Rebase replays a parent's commits when a branch's recorded base is stale #600
gavinsan33
started this conversation in
Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When a branch's recorded base is an older copy of its parent,
gh stack rebaseandsyncreplay the parent's commits onto their own newer copies.git rebase --onto <new> <old>only skips commits whose patch is already in<old>, so each replayed commit conflicts wherever the parent changed it later. Each of those conflicts has only one right answer, which is to keep the new base's version. In one of my stacks, a rebase replayed 61 commits, and 53 of them were copies already in the parent.I have a fix on my fork:
rebase-drop-applied-commits. I couldn't open a PR because PR creation seems limited to collaborators.git rebaseitself uses to skip cherry-picks), it skips that commit and continues. This sits next to the rerere auto-continue intryAutoResolveRebase, so it coversrebase,sync,modifyand--continue, in origin and linked worktrees.Dropped <sha> <subject>: already in the new basethrough a new optionalRebaseOpts.Notify.There are two tests.
TestRebase_DropsCommitsAlreadyInParentis a real-Git regression of a child recorded on an outdated parent, and it fails without the change.TestIntegration_RebaseDropsCommitsAlreadyInBasechecks that a same-patch copy is dropped and a changed-patch copy still stops.go vetand the fullscripts/testsuite pass. I'm happy to open it as a PR if a maintainer can enable that.All reactions