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, 16:33 UTC
Message-ID
<xmqqh8yfq8pr.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170714153015.crklfqaa2qc573zo@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> I think there are basically two mental models that are reasonable:
>
>   1. Uppercase in key names is treated the same as lowercase. Therefore
>      we must allow "alias.Foo" to match "git foo", but "git Foo" can
>      never have a match (in the current schema).
>
>   2. Keys are case-insensitive, and anything that matches them is
>      considered case-insensitive, too. That means "Foo" and "foo" are
>      identical for these purposes, and you can never have two aliases
>      "Foo" and "foo".
>
> In either mental model, "alias.Foo" for "git foo" must work. But the
> reverse only works in (2).
>
> I think either model is fine. These patches push us into (2).

I've always thought that the promise we give our end users is that these keys are case insensitive, and that the fact that we downcase the key before calling config callback is merely an implementation detail. That is why I never considered the possibility that (1) can be a valid mental model.

There are other possible implementations of case insensitivity. We could have been upcasing instead before calling config callback and the users wouldn't have noticed.

So I'd consider that pushing us into (2) is a good thing.
Thanks.
Previous: Jeff KingNext: astian
Message 7 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.