Re: [PATCH] Fix git-bisect when show-branch is configured to run with pager
From: Junio C Hamano <hidden>
Date: 2021-07-28 16:41:14
Christian Couder [off-list ref] writes:
quoted
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.quoted
---- >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 interactives/single/ a single/
Thanks.
quoted
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.