From: Junio C Hamano Date: Thu, 07 Feb 2008 23:32:44 GMT Subject: Re: Bug in git rebase -i where is "HEAD" in 1.5.4? Message-ID: <7vlk5wmjfn.fsf@gitster.siamese.dyndns.org> In-Reply-To: Adam Roben 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] > > If is "HEAD", `git rebase` seems to perform these > (correct) steps: > > A=$(git rev-parse HEAD) > git checkout > 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.