public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: Jonas Rebmann <kernel@schlaraffenlan.de>,
	 git@vger.kernel.org,  Chris Down <chris@chrisdown.name>,
	 Jeff King <peff@peff.net>
Subject: Re: [PATCH v2 1/2] bisect: use selected alternate terms in status output
Date: Tue, 24 Mar 2026 10:33:00 -0700	[thread overview]
Message-ID: <xmqq7br116b7.fsf@gitster.g> (raw)
In-Reply-To: <f8f7a220-c40a-480d-b0d0-abfcf5c83157@gmail.com> (Phillip Wood's message of "Tue, 24 Mar 2026 10:43:06 +0000")

Phillip Wood <phillip.wood123@gmail.com> 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.

  reply	other threads:[~2026-03-24 17:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 22:48 [PATCH v2 0/2] Avoid hardcoded "good"/"bad" bisect terms Jonas Rebmann
2026-03-23 22:48 ` [PATCH v2 1/2] bisect: use selected alternate terms in status output Jonas Rebmann
2026-03-24 10:43   ` Phillip Wood
2026-03-24 17:33     ` Junio C Hamano [this message]
2026-03-23 22:49 ` [PATCH v2 2/2] rev-parse: use selected alternate terms too look up refs Jonas Rebmann
2026-03-24 10:49   ` Phillip Wood
2026-03-24 12:30     ` Jonas Rebmann
2026-03-24 14:11       ` Phillip Wood
2026-03-24 13:45   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7br116b7.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=chris@chrisdown.name \
    --cc=git@vger.kernel.org \
    --cc=kernel@schlaraffenlan.de \
    --cc=peff@peff.net \
    --cc=phillip.wood123@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox