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

Re: [PATCH] rebase: ignore non-branch update-refs

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
May 15, 2026, 15:40 UTC
Message-ID
<956baa65-6448-448f-9f02-fc90068a9413@gmail.com>
In-Reply-To
<0911df2d-aaa2-456e-a678-345239cefc67@gmail.com>
On 10/05/2026 14:37, Phillip Wood wrote:
Show 5 quoted lines
> 
> Looking at make_script_with_merges() it also calls 
> load_branch_decorations() so we should probably add something like the 
> diff below. Having said that this patch is a strict improvement so we 
> can always fix make_script_with_merges() as a follow up.

I've just had another look at this and even though we call load_branch_decorations() after calling setup_revisions_from_strvec() and prepare_revision_walk() we only load branch decorations. It turns out that "%d" calls load_ref_decorations() the first time it formats a commit and because we call load_branch_decorations() before the first call to get_revisions() we haven't formatted any commits yet. So we don't need to worry about rebase.instructionFormat changing the decorations that get loaded when generating the todo list with make_script_with_merges(). "rebase --update-refs" without "-r" only calls load_branch_decorations() after we've formatted a commit which is why it is affected.

Thanks
Phillip
Show 29 quoted lines
> 
> Thanks
> 
> Phillip
> 
> ---- 8< ----
> 
> diff --git b/sequencer.c b/sequencer.c
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -5982,6 +5982,15 @@ static int make_script_with_merges(struct 
> pretty_print_context *pp,
>               const char *label = label_from_message.buf;
>               const struct name_decoration *decoration =
>                   get_name_decoration(&to_merge->item->object);
> +
> +            /*
> +             * If rebase.instructionFormat includes "%d"
> +             * then we to skip non-local decorations as
> +             * we're only interested in branch names
> +             */
> +            while (decoration &&
> +                   decoration->type != DECORATION_REF_LOCAL)
> +                decoration = decoration->next;
> 
>               if (decoration)
>                   skip_prefix(decoration->name, "refs/heads/",
> 
> 
Previous: Phillip Wood
Message 14 of 14 in “rebase: ignore non-branch update-refs”
  1. rebase: ignore non-branch update-refsmail@abhinavg.net, May 6, 2026
  2. Phillip WoodMay 7, 2026
  3. rebase: ignore non-branch update-refsmail@abhinavg.net, May 8, 2026
  4. Phillip WoodMay 8, 2026
  5. 0/1 rebase: ignore non-branch update-refsmail@abhinavg.net, May 10, 2026
  6. 1/1 rebase: ignore non-branch update-refsmail@abhinavg.net, May 10, 2026
  7. Junio C HamanoMay 10, 2026
  8. Phillip WoodMay 10, 2026
  9. Junio C HamanoMay 10, 2026
  10. Abhinav GuptaMay 11, 2026
  11. Junio C HamanoMay 11, 2026
  12. Abhinav GuptaMay 11, 2026
  13. Phillip WoodMay 12, 2026
  14. Phillip WoodMay 15, 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.