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

Re: [PATCH] Fix git-bisect when show-branch is configured to run with pager

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2021, 16:41 UTC
Message-ID
<xmqq8s1qbdcr.fsf@gitster.g>
In-Reply-To
<CAP8UFD26AXTYPvSzBD1x6hSvK5SNbM0F5BPX5bLEbxUZa2dAUg@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 12 quoted lines
>> 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.
Show 18 quoted lines
>>         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.
Previous: Christian CouderNext: Junio C Hamano
Message 6 of 10 in “Fix git-bisect when show-branch is configured to run with pager”
  1. Fix git-bisect when show-branch is configured to run with pagerOded S via GitGitGadget, Jul 26, 2021
  2. Christian CouderJul 26, 2021
  3. Junio C HamanoJul 26, 2021
  4. Junio C HamanoJul 27, 2021
  5. Christian CouderJul 28, 2021
  6. Junio C HamanoJul 28, 2021
  7. Re* [PATCH] Fix git-bisect when show-branch is configured to run with pagerJunio C Hamano, Jul 28, 2021
  8. Christian CouderJul 29, 2021
  9. bisect: disable pager while invoking show-branchOded S via GitGitGadget, Jul 27, 2021
  10. Junio C HamanoJul 27, 2021

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.