From: Jeff King <peff@peff.net>
To: Jonatan Holmgren <jonatan@jontes.page>
Cc: Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, rsch@web.de, michael.grossfeld@amd.com
Subject: Re: [PATCH] alias: restore support for simple dotted aliases
Date: Sat, 25 Apr 2026 19:29:16 -0400 [thread overview]
Message-ID: <20260425232916.GA29816@coredump.intra.peff.net> (raw)
In-Reply-To: <40408c99-7e2a-4cf6-b9b2-6d0e0da3b2c5@jontes.page>
On Sat, Apr 25, 2026 at 11:57:24AM +0200, Jonatan Holmgren wrote:
> That is a challenge we are going to have to consider. I think reserving
> `command` is a worthwhile compromise, but obviously we cannot do that for
> arbitrary future keys such as `help`, `hidden`, etc.
We don't necessarily have to reserve them. When we see alias.foo.bar, we
could consider it as both alias "foo.bar" and the "bar" key of alias
"foo", without regard to what is in "bar" (i.e., whether it is "command"
or "help", etc). I.e., don't "fall back" but allow two overlapping
namespace.s
That is the most backwards-compatible thing we could do, but does create
some interesting situations.
If you define alias.foo.command with the intent to allow "git foo", that
is also creating the identical alias "git foo.command". Probably nobody
cares too much, as if you did not mean to make "foo.command" you would
never invoke it. We'd probably want to omit it when listing aliases,
though.
If we later introduce alias.foo.help, the same thing applies but with a
twist. Running "git foo.help" will invoke that key as an alias command,
but it is probably not a sensible command in the first place. But again,
I'm not sure why anybody would try to do so.
That said, I don't think reserving "command" or even some future names
is that painful in the long run. The three-level syntax is a superset of
the old functionality, and in general the best solution will be for
users to convert their old aliases to it. The benefits of providing the
fallback compatibility are:
1. Users can avoid having to do anything at all. And that will still
be true for the majority, unless they happen to have a three-level
alias that ends with ".command" (for now) or eventually ".help",
etc. We don't have any hard data, but I have to imagine that the
numbers here are vanishingly small.
2. Cross-version compatibility. You can't use alias.pull.sub.command
in Git v2.53 and older, so it's otherwise impossible to have config
that works both there and with v2.54.
But as time goes on, wanting to cross that version boundary becomes
less and less likely. If we we eventually introduce ".help" and it
breaks somebody foo.help alias, suggesting alias.foo.help.command
will work all the way back to Git v2.54, which may be sufficient.
> One possible compromise would be to reserve `command` and `alias-*`, as
> neither seems very likely to exist in users' historical alias names.
>
> A new namespace makes the most sense from a namespace-pollution point of
> view, but I struggle to see that as good UX. Even a separate namespace
> only for alias metadata would make more sense to me than moving aliases
> entirely, since subsection aliases with just `command` will likely be far
> more common than any future metadata keys, but this is not something I see
> as a good solution either.
Yeah. Obviously a totally separate namespace makes all of this go away,
but it feels like we are sacrificing the experience going forward in
order to accommodate some fairly unlikely historical clashes.
-Peff
next prev parent reply other threads:[~2026-04-25 23:29 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
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 [this message]
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=20260425232916.GA29816@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jonatan@jontes.page \
--cc=michael.grossfeld@amd.com \
--cc=rsch@web.de \
/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