# [PATCH] Improve git bisect error message

2 messages from 2008-04-26 to 2008-04-26. Participants: Andi Kleen, Christian Couder.
Thread: https://gitlist.dev/t/13270

## Andi Kleen, 2008-04-26 13:39

Subject: [PATCH] Improve git bisect error message
Message-ID: <20080426133937.GA27677@basil.nowhere.org>
URL: https://gitlist.dev/e/20080426133937.GA27677%40basil.nowhere.org

```

It took me some time to figure out what this error message meant and
how to fix the problem.  So let's improve it a little.

-Andi

--- git-1.5.4/git-bisect~	2008-02-09 13:37:16.000000000 +0100
+++ git-1.5.4/git-bisect	2008-04-26 01:26:19.000000000 +0200
@@ -71,7 +71,10 @@
 		git checkout $branch || exit
 		;;
 	refs/heads/*)
-		[ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree"
+		if [ -s "$GIT_DIR/head-name" ] ; then
+			echo >&2 "Please run git bisect reset"
+			die "won't bisect on seeked tree"
+		fi
 		echo "${head#refs/heads/}" >"$GIT_DIR/head-name"
 		;;
 	*)

```

## Christian Couder, 2008-04-26 18:53

Subject: Re: [PATCH] Improve git bisect error message
Message-ID: <200804262053.00709.chriscool@tuxfamily.org>
URL: https://gitlist.dev/e/200804262053.00709.chriscool%40tuxfamily.org
In-Reply-To: <20080426133937.GA27677@basil.nowhere.org>

```
Le samedi 26 avril 2008, Andi Kleen a écrit :
> It took me some time to figure out what this error message meant and
> how to fix the problem.  So let's improve it a little.

It is very much appreciated that you report a problem and moreover provide a 
patch.

> --- git-1.5.4/git-bisect~	2008-02-09 13:37:16.000000000 +0100
> +++ git-1.5.4/git-bisect	2008-04-26 01:26:19.000000000 +0200

Unfortunately in this case it seems that your git version is too old and the 
problem may have been fixed in newer versions.

See:

http://git.kernel.org/?p=git/git.git;a=commit;h=0f497e75f05cdf0c0c1278eaba898cda6f118d71
http://git.kernel.org/?p=git/git.git;a=commit;h=b577bb925e745845155c6f51eae841c339ce68f6

So I think you should upgrade to git 1.5.5.1 and if possible tell us if you 
still get the same error message. 

Thanks,
Christian.

```
