Re: Bug in git rebase -i where <upstream> is "HEAD" in 1.5.4?
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:11
Adam Roben [off-list ref] writes:
I've discovered a difference in behavior between `git rebase` and `git rebase -i`, and I believe the behavior exhibited by `git rebase - i` is incorrect and should be changed to match `git rebase`. The behavior difference occurs when running the command in the form: git rebase [-i] <upstream> <branch> If <upstream> is "HEAD", `git rebase` seems to perform these (correct) steps: A=$(git rev-parse HEAD) git checkout <branch> git rebase $A
Yes, I remember writing that side carefully, taking exactly this issue into account.
However, `git rebase -i` seems to perform these (incorrect) steps:
Yeah, I see that interactive side is sloppier. In
git-rebase--interactive.sh, if you move
HEAD=$(git rev-parse --verify HEAD) || die "No HEAD?"
UPSTREAM=$(git rev-parse --verify "$1") || die "Invalid base"
around l.481 up so that they come before if test ! -z "$2",
you would be Ok, although I didn't test it.