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

From: Phillip Wood <[email-masked]>
Date: Tue, 24 Mar 2026 10:43:06 +0000

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"

>   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

> +	git bisect term2 $HASH1 >bisect_result &&
> +	grep "status: waiting for term1 commit, 1 term2 commit known" bisect_result &&
>   	git bisect term1 $HASH4 &&
>   	git bisect term1 &&
>   	git bisect term1 >bisect_result &&
> @@ -1103,6 +1105,16 @@ test_expect_success 'bisect replay with term1 and term2' '
>   	git bisect reset
>   '
>   
> +test_expect_success 'bisect run term1 term2' '
> +	git bisect reset &&
> +	git bisect start --term-new term1 --term-old term2 $HASH4 $HASH1 &&
> +	git bisect term1 &&
> +	git bisect run false >bisect_result &&
> +	grep "bisect found first term1 commit" bisect_result &&
> +	git bisect log >log_to_replay.txt &&
> +	git bisect reset
> +'
> +
>   test_expect_success 'bisect start term1 term2' '
>   	git bisect reset &&
>   	git bisect start --term-new term1 --term-old term2 $HASH4 $HASH1 &&
>