git bisect issue

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

git bisect issue

From: <hidden>
Date: 2016-06-15 22:46:33

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

Re: git bisect issue

From: Christian Couder <hidden>
Date: 2016-06-15 22:46:33

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help