From: Jeff King <peff@peff.net>
To: "Grossfeld, Michael" <Michael.Grossfeld@amd.com>
Cc: Jonatan Holmgren <jonatan@jontes.page>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug: Hierarchical Aliases no longer work in 2.54.0
Date: Thu, 23 Apr 2026 17:12:37 -0400 [thread overview]
Message-ID: <20260423211237.GA1906241@coredump.intra.peff.net> (raw)
In-Reply-To: <PH7PR12MB73313034573C59C73F821BBFE52A2@PH7PR12MB7331.namprd12.prod.outlook.com>
On Thu, Apr 23, 2026 at 06:19:42PM +0000, Grossfeld, Michael wrote:
> Hello all! Seeing this issue on 2.54.0 and it didn't look like anyone had reported it yet.
Thanks for the report. I think you're the first.
> > What did you do before the bug happened? (Steps to reproduce your issue)
>
> Attempting to use the hierarchical alias "pull.sub", which was working
> in 2.53.0, is no longer working in 2.54.0.
> It returns the following error: "git: 'pull.sub' is not a git command.
> See 'git --help'."
Here's a shorter reproduction recipe:
git -c alias.foo.bar='!echo ok' foo.bar
With v2.53 it produces "ok", and in v2.54 you get:
git: 'foo.bar' is not a git command. See 'git --help'.
This is due to the introduction of the three-level alias syntax in
ac1f12a9de (alias: support non-alphanumeric names via subsection syntax,
2026-02-18). We now allow "git foo" to expand based on both alias.foo
and alias.foo.command, the latter of which allows more flexible syntax.
But now we think you are trying to set the "sub" key of the "pull"
alias, which is obviously nonsense. I don't think three-level config
like this was ever a planned feature in the original alias expansion,
but it did indeed work. So I think this is a regression worth fixing.
In the short-term, you can work around it by using the new syntax:
[alias "pull.sub"]
command = ...whatever...
And I think we'd want a fix something like this:
diff --git a/alias.c b/alias.c
index ec9833dd30..58f21ac6ba 100644
--- a/alias.c
+++ b/alias.c
@@ -34,8 +34,20 @@ static int config_alias_cb(const char *var, const char *value,
if (subsection && !subsection_len)
subsection = NULL;
- if (subsection && strcmp(key, "command"))
- return 0;
+ if (subsection && strcmp(key, "command")) {
+ /*
+ * We have historically support the "alias.name" form when
+ * "name" happens to contain dots (e.g., alias.foo.bar to allow
+ * "git foo.bar". But our parsing above would split that into
+ * subsection "foo".
+ *
+ * If we do not understand the final key in a subsection-style
+ * variable, fall back to treating it as a two-level alias.
+ */
+ key = subsection;
+ subsection = NULL;
+ subsection_len = 0;
+ }
if (data->alias) {
int match;
That does still break a historical alias if you happened to call it
"foo.command". I'm not sure if we want to try to be even more thorough
and fall back on that case, or if we're getting now into unlikely
hypotheticals.
-Peff
next prev parent reply other threads:[~2026-04-23 21:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 18:19 Bug: Hierarchical Aliases no longer work in 2.54.0 Grossfeld, Michael
2026-04-23 21:12 ` Jeff King [this message]
2026-04-23 22:55 ` Michael Grossfeld
2026-04-23 21:36 ` René Scharfe
2026-04-23 22:46 ` Michael Grossfeld
2026-04-24 7:29 ` Jonatan Holmgren
2026-04-24 15:10 ` [PATCH] alias: restore support for simple dotted aliases Jonatan Holmgren
2026-04-24 16:09 ` Kristoffer Haugsbakk
2026-04-24 22:47 ` Junio C Hamano
2026-04-25 9:57 ` Jonatan Holmgren
2026-04-25 23:29 ` Jeff King
2026-04-25 23:47 ` Jeff King
2026-04-26 19:21 ` Jonatan Holmgren
2026-04-26 23:01 ` Jeff King
2026-04-27 8:36 ` Jonatan Holmgren
2026-05-12 4:43 ` Junio C Hamano
2026-04-24 16:17 ` Jonatan Holmgren
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=20260423211237.GA1906241@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=Michael.Grossfeld@amd.com \
--cc=git@vger.kernel.org \
--cc=jonatan@jontes.page \
/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