Re: [PATCH] Fix git-bisect when show-branch is configured to run with pager
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/
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.