Re: [BUG] git bisect start fails when stale bisect data is left behind
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Sep 6, 2011, 07:48 UTC
- Message-ID
- <CAP8UFD1h059dOyjszcP-qFauyho78c0RHBMQsGOPFgzZtp+7vg@mail.gmail.com>
- In-Reply-To
- <CAC6WLetwT9UvBY_=Nf38hhkyU1mhmdWHWqscf3ebba1WRGS1LQ@mail.gmail.com>
Hi,
On Mon, Sep 5, 2011 at 1:15 PM, Joel Kaasinen <joel@zenrobotics.com> wrote:
Show 11 quoted lines
> Hi, > > Just bumped into a weird bug: bisect refused to start. It seems some > previous bisect had left around state that referred to a > now-nonexistent branch. > > How to reproduce: > $ echo foo > .git/BISECT_START > $ git bisect start HEAD HEAD^ > > Fails with "fatal: invalid reference:" on git 1.7.6.
Yeah, it looks like a very old behavior. I'd suggest a simple improvement in the error message like this:
diff --git a/git-bisect.sh b/git-bisect.sh index c21e33c..bd7155b 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -67,7 +67,8 @@ bisect_start() { then # Reset to the rev from where we started. start_head=$(cat "$GIT_DIR/BISECT_START") - git checkout "$start_head" -- || exit + git checkout "$start_head" -- || + die "Could not checkout previous start point '$start_head'. Try 'git bisect reset <branch>' first." else # Get rev from where we start. case "$head" in If there is no objection I will provide a proper patch. Thanks, Christian.