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

Re: Bug: Hierarchical Aliases no longer work in 2.54.0

From
Jeff King <peff@peff.net>
Date
Apr 23, 2026, 21:12 UTC
Message-ID
<20260423211237.GA1906241@coredump.intra.peff.net>
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.
Show 6 quoted lines
> > 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
Previous: Grossfeld, MichaelNext: Michael Grossfeld
Message 2 of 18 in “Bug: Hierarchical Aliases no longer work in 2.54.0”
  1. Grossfeld, MichaelApr 23, 2026
  2. Jeff KingApr 23, 2026
  3. Michael GrossfeldApr 23, 2026
  4. René ScharfeApr 23, 2026
  5. Michael GrossfeldApr 23, 2026
  6. Jonatan HolmgrenApr 24, 2026
  7. alias: restore support for simple dotted aliasesJonatan Holmgren, Apr 24, 2026
  8. Kristoffer HaugsbakkApr 24, 2026
  9. Junio C HamanoApr 24, 2026
  10. Jonatan HolmgrenApr 25, 2026
  11. Jeff KingApr 25, 2026
  12. Jeff KingApr 25, 2026
  13. Jonatan HolmgrenApr 26, 2026
  14. Jeff KingApr 26, 2026
  15. Jonatan HolmgrenApr 27, 2026
  16. Junio C HamanoMay 12, 2026
  17. Jeff KingMay 19, 2026
  18. alias: restore support for simple dotted aliasesJonatan Holmgren, Apr 24, 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.