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

Re: git bisect should return 1 when the first bad commit is found

From
PLPedro Larroy <pedro.larroy.lists@gmail.com>
Date
Jun 23, 2019, 20:32 UTC
Message-ID
<CAC_CU1hHK5n4GcETbWFLBeqT_Y9LV6N32Rv0F0+OCXH2G0qg8Q@mail.gmail.com>
In-Reply-To
<xmqq5zp9wdjb.fsf@gitster-ct.c.googlers.com>
Thanks for your answer.
I was expecting the HEAD to point to the first bad commit.

In mercurial, the exit status tells you information about the bisection process: https://www.mercurial-scm.org/repo/hg/help/bisect

Sure one can parse stdout, it's just more tedious than just checking the return code and having the HEAD left to the original bad commit.

Pedro.
On Thu, Jun 13, 2019 at 11:22 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
>
> Pedro Larroy <pedro.larroy.lists@gmail.com> writes:
>
> > I'm using git bisect, and for complex reasons I can't use git bisect
> > run to drive the bisection. I don't think git bisect bad/good is
> > returning a different status code when the first bad commit is found
> > and this would be very useful to stop the driver of the bisection.
> >
> > What do you think?  Would such a change be acceptable?
>
> Probably not.
>
> A non-zero exit code would indicate that "git bisect" had trouble
> finding the next commit to check after being told 'good' (or 'bad'),
> which you wouldn't be able to tell from your "first bad one is
> found".
>
> The 'first bad one' is not necessarily the HEAD when the bisect
> procedure finds it, so you'd have to read and parse "x is the first
> such commit" message anyway, no?  And once you start parsing the
> message from 'git bisect', you should be able to tell between
> "please try this one, you have approximately 7 steps left" and "we
> found the first bad one, which is X", without relying on the exit
> status, no?
>
Previous: Junio C HamanoNext: Jeff King
Message 3 of 9 in “git bisect should return 1 when the first bad commit is found”
  1. Pedro LarroyJun 12, 2019
  2. Junio C HamanoJun 13, 2019
  3. Pedro LarroyJun 23, 2019
  4. Jeff KingJun 23, 2019
  5. Christian CouderJun 24, 2019
  6. Jeff KingJun 25, 2019
  7. Junio C HamanoJun 24, 2019
  8. Jeff KingJun 25, 2019
  9. Junio C HamanoJun 25, 2019

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.