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

Re: [PATCH 0/2] Fix regression: CamelCased aliases

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 14, 2017, 15:14 UTC
Message-ID
<xmqq60evrqyd.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170714090256.ne4gqgppt2qshtak@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> On Fri, Jul 14, 2017 at 10:39:24AM +0200, Johannes Schindelin wrote:
>
>> It was possible before v2.13.3 to invoke:
>> 
>> 	git config alias.CamelCased <something>
>> 	git CamelCased
>> 
>> This regressed (due to a stupid mistake of mine that was not caught in
>> patch review, sadly) in v2.13.3.
>
> Interesting. I don't think this was ever intended to work.
> ...
> The patches look obviously correct.

How can something be "(n)ever intended to work" and yet patches to make it work be "obviously correct"? ;-)

My first/knee-jerk reation to the title of the series also was "letter cases are not supposed to work in aliases", but that depends on the definition of "work". When you add 'alias.Foo', you are not supposed to be able to make 'git foo' behave differently from that alias you defined. In order to make that, which is not supposed to work, work, we'd need to introduce alias.Foo.commmand, as you said.

But I think that it is still reasonable for an end user to expect that 'git Foo' would trigger that alias. And that is what was recently changed, inadvertently.

So the problem may need to be explained better in this series, but I think the usage was expected to work and the series is fixing a real regression.

Do we want to promise to keep the following "working"?
    git config alias.Foo <something>
    git foo

By designing the system in such a way that an alias is created with a two-level name in our system, we are saying that alias names are case insensitive to the end users, so I _think_ the above is intended to work, and we are effectively promising that it will keep working.

It is a different matter if that design decision was sensible, though.

> As a meta-comment, I find splitting the tests from the fix like this
> makes review more tedious.
I agree.
Previous: Jeff KingNext: Jeff King
Message 5 of 10 in “Fix regression: CamelCased aliases”
  1. 0/2 Fix regression: CamelCased aliasesJohannes Schindelin, Jul 14, 2017
  2. 1/2 t1300: demonstrate that CamelCased aliases regressedJohannes Schindelin, Jul 14, 2017
  3. 2/2 alias: compare alias name *case-insensitively*Johannes Schindelin, Jul 14, 2017
  4. Jeff KingJul 14, 2017
  5. Junio C HamanoJul 14, 2017
  6. Jeff KingJul 14, 2017
  7. Junio C HamanoJul 14, 2017
  8. astianJul 14, 2017
  9. Jeff KingJul 14, 2017
  10. Junio C HamanoJul 15, 2017

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.