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

Re: [PATCH v2 1/2] bisect: use selected alternate terms in status output

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2026, 17:33 UTC
Message-ID
<xmqq7br116b7.fsf@gitster.g>
In-Reply-To
<f8f7a220-c40a-480d-b0d0-abfcf5c83157@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 25 quoted lines
> Hi Jonas
>
> On 23/03/2026 22:48, Jonas Rebmann wrote:
>> 
>> diff --git a/builtin/bisect.c b/builtin/bisect.c
>> index 4520e585d0..ee6a2c83b8 100644
>> --- a/builtin/bisect.c
>> +++ b/builtin/bisect.c
>> @@ -465,13 +465,16 @@ static void bisect_print_status(const struct bisect_terms *terms)
>>   		return;
>>   
>>   	if (!state.nr_good && !state.nr_bad)
>> -		bisect_log_printf(_("status: waiting for both good and bad commits\n"));
>> +		bisect_log_printf(_("status: waiting for both %s and %s commits\n"),
>> +				  terms->term_good, terms->term_bad);
>
> If we're going to start using alternative terms it might be better to 
> enclose them in single quotes to make it clearer that we're referencing 
> the term names. Looking at the test below
>
> 	"status: waiting for both 'term1' and 'term2' commits"
>
> is clearer to me than
>
> 	"status: waiting for both term1 and term2 commits"

Excellent. I failed to consider this, but your reasoning makes perfect sense. When we were limited to hardcoded good and bad, they were clear enough without 'highlighting' with quotes, but that is no longer the case.

Show 13 quoted lines
>>   test_expect_success 'bisect start with one term1 and term2' '
>>   	git bisect reset &&
>> -	git bisect start --term-old term2 --term-new term1 &&
>> -	git bisect term2 $HASH1 &&
>> +	git bisect start --term-old term2 --term-new term1 >bisect_result &&
>> +	grep "status: waiting for both term2 and term1 commits" bisect_result &&
>
> Using test_grep would make debugging test failures easier as, if it 
> fails, it prints a helpful diagnostic message.
>
> Thanks
>
> Phillip
Thanks for helping.
Previous: Phillip WoodNext: Jonas Rebmann
Message 4 of 9 in “Avoid hardcoded "good"/"bad" bisect terms”
  1. 0/2 Avoid hardcoded "good"/"bad" bisect termsJonas Rebmann, Mar 23, 2026
  2. 1/2 bisect: use selected alternate terms in status outputJonas Rebmann, Mar 23, 2026
  3. Phillip WoodMar 24, 2026
  4. Junio C HamanoMar 24, 2026
  5. 2/2 rev-parse: use selected alternate terms too look up refsJonas Rebmann, Mar 23, 2026
  6. Phillip WoodMar 24, 2026
  7. Jonas RebmannMar 24, 2026
  8. Phillip WoodMar 24, 2026
  9. Junio C HamanoMar 24, 2026

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.