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

Re: [BUG] git bisect start fails when stale bisect data is left behind

From
Christian Couder <christian.couder@gmail.com>
Date
Sep 6, 2011, 07:48 UTC
Message-ID
<CAP8UFD1h059dOyjszcP-qFauyho78c0RHBMQsGOPFgzZtp+7vg@mail.gmail.com>
In-Reply-To
<CAC6WLetwT9UvBY_=Nf38hhkyU1mhmdWHWqscf3ebba1WRGS1LQ@mail.gmail.com>
Hi,
On Mon, Sep 5, 2011 at 1:15 PM, Joel Kaasinen <joel@zenrobotics.com> wrote:
Show 11 quoted lines
> 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 <branch>' first."
        else
                # Get rev from where we start.
                case "$head" in

If there is no objection I will provide a proper patch.

Thanks,
Christian.
Previous: Joel KaasinenNext: Junio C Hamano
Message 2 of 6 in “[BUG] git bisect start fails when stale bisect data is left behind”
  1. Joel KaasinenSep 5, 2011
  2. Christian CouderSep 6, 2011
  3. Junio C HamanoSep 6, 2011
  4. Christian CouderSep 7, 2011
  5. Joel KaasinenSep 7, 2011
  6. Junio C HamanoSep 7, 2011

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.