Git development
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, mail@abhinavg.net
Cc: git@vger.kernel.org, Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH] rebase: ignore non-branch update-refs
Date: Fri, 15 May 2026 16:40:29 +0100	[thread overview]
Message-ID: <956baa65-6448-448f-9f02-fc90068a9413@gmail.com> (raw)
In-Reply-To: <0911df2d-aaa2-456e-a678-345239cefc67@gmail.com>

On 10/05/2026 14:37, Phillip Wood wrote:
> 
> 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

> 
> 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/",
> 
> 


      parent reply	other threads:[~2026-05-15 15:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06  2:39 [PATCH] rebase: ignore non-branch update-refs mail
2026-05-07 16:08 ` Phillip Wood
2026-05-08  1:58 ` [PATCH v2] " mail
2026-05-08 10:07   ` Phillip Wood
2026-05-10 22:41   ` [PATCH v3 0/1] " mail
2026-05-10 22:41     ` [PATCH v3 1/1] " mail
2026-05-10  1:11 ` [PATCH] " Junio C Hamano
2026-05-10 13:37   ` Phillip Wood
2026-05-10 23:37     ` Junio C Hamano
2026-05-11  0:15       ` Abhinav Gupta
2026-05-11  0:20         ` Junio C Hamano
2026-05-11  0:33           ` Abhinav Gupta
2026-05-12 15:10         ` Phillip Wood
2026-05-15 15:40     ` Phillip Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=956baa65-6448-448f-9f02-fc90068a9413@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mail@abhinavg.net \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox