git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git <git@vger.kernel.org>,
	Oded S via GitGitGadget <gitgitgadget@gmail.com>,
	Oded S <oded@istraresearch.com>
Subject: Re: [PATCH] Fix git-bisect when show-branch is configured to run with pager
Date: Wed, 28 Jul 2021 09:41:08 -0700	[thread overview]
Message-ID: <xmqq8s1qbdcr.fsf@gitster.g> (raw)
In-Reply-To: <CAP8UFD26AXTYPvSzBD1x6hSvK5SNbM0F5BPX5bLEbxUZa2dAUg@mail.gmail.com> (Christian Couder's message of "Wed, 28 Jul 2021 08:37:01 +0200")

Christian Couder <christian.couder@gmail.com> writes:

>> I wonder if it is just a simple matter of a few lines of code, like
>> this?
>
> Yeah, I also think it's a good idea.
>
>> ---- >8 ------- >8 ------- >8 ------- >8 ------- >8 ----
>> Subject: [PATCH] bisect: do not run show-branch just to show the current  commit
>>
>> In scripted versions of "git bisect", we used "git show-branch" to
>> describe single commit in the bisect log and also to the interactive
>
> s/single/ a single/

Thanks.

>>         enum bisect_error res = BISECT_OK;
>> +       struct commit *commit;
>> +       struct pretty_print_context pp = {0};
>> +       struct strbuf commit_msg = STRBUF_INIT;
>> ...
>> +       commit = lookup_commit_reference(the_repository, bisect_rev);
>> +       format_commit_message(commit, "[%H] %s%n", &commit_msg, &pp);
>> +       fputs(commit_msg.buf, stdout);
>> +       strbuf_release(&commit_msg);
>> +
>>         return -abs(res);
>
> Nice! Now, the above line can be simplified to:
>
>          return BISECT_OK;
>
> And the declaration of the `res` variable can be moved into the else
> clause where it is used.

Thanks, again.

  reply	other threads:[~2021-07-28 16:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 15:00 [PATCH] Fix git-bisect when show-branch is configured to run with pager Oded S via GitGitGadget
2021-07-26 18:13 ` Christian Couder
2021-07-26 18:39 ` Junio C Hamano
2021-07-27 18:22   ` Junio C Hamano
2021-07-28  6:37     ` Christian Couder
2021-07-28 16:41       ` Junio C Hamano [this message]
2021-07-28 17:07         ` Re* " Junio C Hamano
2021-07-29  2:34           ` Christian Couder
2021-07-27  8:12 ` [PATCH v2] bisect: disable pager while invoking show-branch Oded S via GitGitGadget
2021-07-27 18:29   ` 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=xmqq8s1qbdcr.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=oded@istraresearch.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).