git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git bisect issue

From
Christian Couder <chriscool@tuxfamily.org>
Date
Apr 4, 2009, 19:48 UTC
Message-ID
<200904042148.32723.chriscool@tuxfamily.org>
In-Reply-To
<Pine.LNX.4.64.0904041307360.10230@linmac.oyster.ru>
Hi,
Le samedi 4 avril 2009, malc@pulsesoft.com a écrit :
Show 11 quoted lines
> 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.
Previous: malc@pulsesoft.com
Message 2 of 2 in “git bisect issue”
  1. malc@pulsesoft.comApr 4, 2009
  2. Christian CouderApr 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.