Re: Bug in git rebase -i where <upstream> is "HEAD" in 1.5.4?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 7, 2008, 23:32 UTC
- Message-ID
- <7vlk5wmjfn.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <D94A5309-3EB0-46FA-9114-D11376585DBB@apple.com>
Adam Roben <aroben@apple.com> writes:
Show 13 quoted lines
> 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.