Re: Scriptable mode for git bisect
Oh thank you, I didn’t know that / didn’t grasp that while reading (apparently too fast) your previous mails.
That is way nicer.
Thank you.
Claus
Show 28 quoted lines
> On 25.09.2022, at 02:59, Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:
>
> 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