All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: Claus Fischer <claus.fischer@clausfischer.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org,
	Christian Couder <christian.couder@gmail.com>
Subject: Re: Scriptable mode for git bisect
Date: Sun, 25 Sep 2022 07:59:27 +0700	[thread overview]
Message-ID: <Yy+n7/NolP5rCpwX@danh.dev> (raw)
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:
> 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

  parent reply	other threads:[~2022-09-25  0:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 20:54 Scriptable mode for git bisect Claus Fischer
2022-09-24  1:44 ` Đoàn Trần Công Danh
2022-09-24  9:32   ` Claus Fischer
2022-09-24  9:46     ` Đoàn Trần Công Danh
2022-09-24 16:24   ` Junio C Hamano
     [not found]     ` <69B998A9-0E3E-45F0-8733-F2A3F11625A5@clausfischer.com>
2022-09-25  0:59       ` Đoàn Trần Công Danh [this message]
2022-09-25 12:42         ` Claus Fischer
2022-09-26 17:00           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yy+n7/NolP5rCpwX@danh.dev \
    --to=congdanhqx@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=claus.fischer@clausfischer.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.