# git bisect issue

2 messages from 2009-04-04 to 2009-04-04. Participants: malc@pulsesoft.com, Christian Couder.
Thread: https://gitlist.dev/t/18710

## malc@pulsesoft.com, 2009-04-04 09:11

Subject: git bisect issue
Message-ID: <Pine.LNX.4.64.0904041307360.10230@linmac.oyster.ru>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0904041307360.10230%40linmac.oyster.ru

```
Hello,

I was trying to run git bisect today and stumbled upon this:

$ git bisect start
error: pathspec 'bisect' did not match any file(s) known to git.

.git had some (stale?) BISECT_XXX files in it, and removing them
helped. One of those (BISECT_START) consisted of a single line:
"bisect". If i remember correctly i used to have a bisect branch
in this particular repo.

-- 
mailto:av1474@comtv.ru

```

## Christian Couder, 2009-04-04 19:48

Subject: Re: git bisect issue
Message-ID: <200904042148.32723.chriscool@tuxfamily.org>
URL: https://gitlist.dev/e/200904042148.32723.chriscool%40tuxfamily.org
In-Reply-To: <Pine.LNX.4.64.0904041307360.10230@linmac.oyster.ru>

```
Hi,

Le samedi 4 avril 2009, malc@pulsesoft.com a écrit :
> Hello,
>
> I was trying to run git bisect today and stumbled upon this:
>
> $ git bisect start
> error: pathspec 'bisect' did not match any file(s) known to git.
>
> .git had some (stale?) BISECT_XXX files in it, and removing them
> helped. One of those (BISECT_START) consisted of a single line:
> "bisect". If i remember correctly i used to have a bisect branch
> in this particular repo.

When you start bisecting, the current branch is saved in .git/BISECT_START 
so if you started a bisection in a branch named "bisect", then "bisect" was 
saved in ".git/BISECT_START". Then you probably didn't use "git bisect 
reset" to stop bisecting, so the .git/BISECT_START file was not removed.

You probably deleted the "bisect" branch and later when you started a new 
bisection, "git bisect" found the .git/BISECT_START file, so it thought 
that you were currently bisecting.

It then tryed to abort the previous bisection by going back to branch saved 
in the .git/BISECT_START file, and that failed with the error message you 
saw.

The error message could perhaps be improved with this patch:

diff --git a/git-bisect.sh b/git-bisect.sh
index e313bde..093736c 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -77,7 +77,7 @@ 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" -- || exit
        else
                # Get rev from where we start.
                case "$head" in

it will give the following error message instead of the one you saw:

fatal: invalid reference: bisect

Regards,
Christian.

```
