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

From: Junio C Hamano <[email-masked]>
Date: Tue, 24 Mar 2026 10:33:00 -0700

Phillip Wood <[email-masked]> writes:

> 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.

>>   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.