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

Re: Scriptable mode for git bisect

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
Sep 25, 2022, 00:59 UTC
Message-ID
<Yy+n7/NolP5rCpwX@danh.dev>
In-Reply-To
<69B998A9-0E3E-45F0-8733-F2A3F11625A5@clausfischer.com>
On 2022-09-25 01:46:13+0200, Claus Fischer <claus.fischer@clausfischer.com> wrote:
Show 13 quoted lines
> Well since I usually don’t have many revisions backwards, typically
> no more than 50, I can just traverse the tree backwards from main.
> I remember the last ‘bad’ revision before the good one.
> So there’s a solution for me.
> 
> Yes the bisect command puts the correct ‘first bad’ revision in its
> output but it’s surrounded by a large amount of useless text. It
> would be nice to have a ‘quiet’ flag that lets it output just the
> bad revision. Alternatively, that it ends by checking out just that
> bad revision before revert.
> 
> My problem is solved by stepping backwards to HEAD~1 each time, but
> you might consider making bisect more scriptable.

No, you don't need to parse "git bisect" output to get the "first bad" revision. The "first bad" revision is stored in refs/bisect/bad.

And you can take the "first bad" revision in a scriptable way with:
	FIRST_BAD=$(git rev-parse --verify refs/bisect/bad)
Of course, after finishing bisecting.
-- 
Danh
Previous: Junio C HamanoNext: Claus Fischer
Message 6 of 8 in “Scriptable mode for git bisect”
  1. Claus FischerSep 23, 2022
  2. Đoàn Trần Công DanhSep 24, 2022
  3. Claus FischerSep 24, 2022
  4. Đoàn Trần Công DanhSep 24, 2022
  5. Junio C HamanoSep 24, 2022
  6. Đoàn Trần Công DanhSep 25, 2022
  7. Claus FischerSep 25, 2022
  8. Junio C HamanoSep 26, 2022

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.