From: Junio C Hamano <gitster@pobox.com>
To: mail@abhinavg.net
Cc: git@vger.kernel.org, Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH] rebase: ignore non-branch update-refs
Date: Sun, 10 May 2026 10:11:15 +0900 [thread overview]
Message-ID: <xmqqqznk9ih8.fsf@gitster.g> (raw)
In-Reply-To: <20260506023944.90691-1-mail@abhinavg.net> (mail@abhinavg.net's message of "Tue, 5 May 2026 19:39:43 -0700")
mail@abhinavg.net writes:
> diff --git a/sequencer.c b/sequencer.c
> index b7d8dca47f..25bcfc5da0 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -6428,6 +6428,16 @@ static int add_decorations_to_list(const struct commit *commit,
> const char *path;
> size_t base_offset = ctx->buf->len;
>
> + /*
> + * The global decoration table may contain names loaded by
> + * a previous pretty format such as "%d".
> + * This will result in refs such as "HEAD" being present.
> + */
Your long topic branch may have local unannotated tags that point
into the middle of it, marking strategic points in the topic.
With this change, the command no longer moves them when it rebases
the entire topic. Isn't it a regression?
> + if (decoration->type != DECORATION_REF_LOCAL) {
> + decoration = decoration->next;
> + continue;
> + }
In other words, what you want to prevent from appearing in the insn
stream may be "HEAD", but if so, "must be DECORATION_REF_LOCAL" is
too broad a net to catch it, and causing unintended collateral damage.
As to the style, as the body of the new conditional works
identically with the existing code to exclude the current branch, I
wonder why it shouldn't read more like this? The following
illustration still uses "must be DECORATION_REF_LOCAL" and that may
have to be corrected, of course.
sequencer.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git i/sequencer.c w/sequencer.c
index b7d8dca47f..1ba95fbae1 100644
--- i/sequencer.c
+++ w/sequencer.c
@@ -6429,10 +6429,12 @@ static int add_decorations_to_list(const struct commit *commit,
size_t base_offset = ctx->buf->len;
/*
- * If the branch is the current HEAD, then it will be
- * updated by the default rebase behavior.
+ * Exclude the "current" branch, which will be updated
+ * by the default rebase behavior. Exclude non-branch
+ * decorations as well.
*/
- if (head_ref && !strcmp(head_ref, decoration->name)) {
+ if ((head_ref && !strcmp(head_ref, decoration->name)) ||
+ (decoration->type != DECORATION_REF_LOCAL)) {
decoration = decoration->next;
continue;
}
next prev parent reply other threads:[~2026-05-10 1:11 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 ` Junio C Hamano [this message]
2026-05-10 13:37 ` [PATCH] " 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
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=xmqqqznk9ih8.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mail@abhinavg.net \
--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