git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:21 UTC

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

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Mar 24, 2026, 10:43 UTC
Message-ID
<f8f7a220-c40a-480d-b0d0-abfcf5c83157@gmail.com>
In-Reply-To
<20260323-bisect-terms-v2-1-8d6bdb2c9c7e@schlaraffenlan.de>
Hi Jonas
On 23/03/2026 22:48, Jonas Rebmann wrote:
Show 12 quoted lines
> 
> 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"
Show 6 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
Show 23 quoted lines
> +	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 &&
> 
Previous: Jonas RebmannNext: Phillip Wood
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. 2/2 rev-parse: use selected alternate terms too look up refsJonas Rebmann, Mar 23, 2026
  4. Phillip WoodMar 24, 2026
  5. Phillip WoodMar 24, 2026
  6. Jonas RebmannMar 24, 2026
  7. Junio C HamanoMar 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.