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

Re: [PATCH 2/2] status: improve rebase todo list parsing

From
Tian Yuchen <cat@malon.dev>
Date
Apr 20, 2026, 16:38 UTC
Message-ID
<b62a96c5-fab4-4c6d-9768-ade48a8476ca@malon.dev>
In-Reply-To
<d20dc1f6550078883995ae963b91faaa00984c6e.1776697483.git.phillip.wood@dunelm.org.uk>
Hi Phillip,
On 4/20/26 23:04, Phillip Wood wrote:
Show 5 quoted lines
> +	if (!starts_with(p, abbrev))
> +		goto out; /* object name was a refname containing only xdigits */
> +	p += strlen(abbrev);
> +	strbuf_remove(line, p - line->buf, end_of_object_name - p);
> +	end_of_object_name = p;
Show 7 quoted lines
> -	if ((2 <= string_list_split(&split, line->buf, " ", 2)) &&
> -	    !repo_get_oid(r, split.items[1].string, &oid)) {
> -		strbuf_reset(line);
> -		strbuf_addf(line, "%s ", split.items[0].string);
> -		strbuf_add_unique_abbrev(line, &oid, DEFAULT_ABBREV);
> -		for (size_t i = 2; i < split.nr; i++)
> -			strbuf_addf(line, " %s", split.items[i].string);

I noticed that after this patch, refnames shorter than seven characters are no longer standardised to the standard seven-character length, because the 'start_with()' function always returns FALSE. The code jumps directly to 'out', without completing or cutting the refname.

I’m not sure if this was your intention, but I just want to point it out for your information.

(Also noted that there is a very rare scenario where the OID of a refname longer than 7 characters happens to begin with the refname itself; in this case, 'start_with' returns TRUE and the string is cut incorrectly. However, I think we can safely ignore this.)

Regards, Yuchen
Previous: Phillip WoodNext: Phillip Wood
Message 5 of 29 in “status: improve rebase todo list parsing”
  1. 0/2 status: improve rebase todo list parsingPhillip Wood, Apr 20, 2026
  2. 1/2 sequencer: factor out parsing of todo commandsPhillip Wood, Apr 20, 2026
  3. Elijah NewrenApr 22, 2026
  4. 2/2 status: improve rebase todo list parsingPhillip Wood, Apr 20, 2026
  5. Tian YuchenApr 20, 2026
  6. Phillip WoodApr 21, 2026
  7. Elijah NewrenApr 22, 2026
  8. Patrick SteinhardtApr 22, 2026
  9. Phillip WoodApr 22, 2026
  10. Phillip WoodApr 22, 2026
  11. 0/2 status: improve rebase todo list parsingPhillip Wood, May 1, 2026
  12. 1/2 sequencer: factor out parsing of todo commandsPhillip Wood, May 1, 2026
  13. 2/2 status: improve rebase todo list parsingPhillip Wood, May 1, 2026
  14. Junio C HamanoMay 31, 2026
  15. Phillip WoodJun 1, 2026
  16. Junio C HamanoJun 11, 2026
  17. Phillip WoodJun 22, 2026
  18. Phillip WoodMay 1, 2026
  19. 0/2 status: improve rebase todo list parsingPhillip Wood, Jun 22, 2026
  20. 1/2 sequencer: factor out parsing of todo commandsPhillip Wood, Jun 22, 2026
  21. Junio C HamanoJun 22, 2026
  22. Phillip WoodJun 23, 2026
  23. 2/2 status: improve rebase todo list parsingPhillip Wood, Jun 22, 2026
  24. Junio C HamanoJun 22, 2026
  25. Junio C HamanoJun 22, 2026
  26. Phillip WoodJun 23, 2026
  27. 0/2 status: improve rebase todo list parsingPhillip Wood, Jun 23, 2026
  28. 1/2 sequencer: factor out parsing of todo commandsPhillip Wood, Jun 23, 2026
  29. 2/2 status: improve rebase todo list parsingPhillip Wood, Jun 23, 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.