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

Re: [PATCH v2 2/2] rev-parse: use selected alternate terms too look up refs

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2026, 13:45 UTC
Message-ID
<87fr5pjq7n.fsf@gitster.g>
In-Reply-To
<20260323-bisect-terms-v2-2-8d6bdb2c9c7e@schlaraffenlan.de>
Jonas Rebmann <kernel@schlaraffenlan.de> writes:
Show 21 quoted lines
>  #include "abspath.h"
> +#include "bisect.h"
>  #include "config.h"
>  #include "commit.h"
>  #include "environment.h"
> @@ -940,11 +941,14 @@ int cmd_rev_parse(int argc,
>  				continue;
>  			}
>  			if (!strcmp(arg, "--bisect")) {
> +				char *term_bad = NULL;
> +				char *term_good = NULL;
>  				struct refs_for_each_ref_options opts = { 0 };
> -				opts.prefix = "refs/bisect/bad";
> +				read_bisect_terms(&term_bad, &term_good);
> +				opts.prefix = xstrfmt("refs/bisect/%s", term_bad);
>  				refs_for_each_ref_ext(get_main_ref_store(the_repository),
>  						      show_reference, NULL, &opts);
> -				opts.prefix = "refs/bisect/good";
> +				opts.prefix = xstrfmt("refs/bisect/%s", term_good);
>  				refs_for_each_ref_ext(get_main_ref_store(the_repository),
>  						      anti_reference, NULL, &opts);
Aren't return values from two xstrfmt() calls leaking in this code?
>  				continue;
Previous: Phillip Wood
Message 9 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.