From: Christian Couder Date: Tue, 06 Sep 2011 07:48:34 GMT Subject: Re: [BUG] git bisect start fails when stale bisect data is left behind Message-ID: In-Reply-To: Hi, On Mon, Sep 5, 2011 at 1:15 PM, Joel Kaasinen wrote: > 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 ' first." else # Get rev from where we start. case "$head" in If there is no objection I will provide a proper patch. Thanks, Christian.