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

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

From
Jeff King <peff@peff.net>
Date
Jul 14, 2017, 17:40 UTC
Message-ID
<20170714174002.xjizkofjxlirgnaj@sigill.intra.peff.net>
In-Reply-To
<1d79b017-38b3-e1cb-a4bf-1153dc4fdbca@eclipso.at>
On Fri, Jul 14, 2017 at 05:26:00PM +0000, astian wrote:
> FWIW, I don't like 2, I don't like the irregularity in the invocation:

Without quoting, it took me a second to figure out what you meant. But I think "2" here is the "mental model 2" I mentioned in my earlier email.

Show 21 quoted lines
>   $ git branch
>   * master
>   $ git BRANCH
>   git: 'BRANCH' is not a git command. See 'git --help'.
>   $ git config alias.br 'branch -v'
>   $ git br
>   * master 51c785c initial
>   $ git BR
>   * master 51c785c initial
> 
> There is also this:
> 
>   $ git branch
>   * master
>   $ git BRANCH
>   git: 'BRANCH' is not a git command. See 'git --help'.
>   $ git config alias.branch 'branch -v'
>   $ git branch
>   * master
>   $ git BRANCH
>   * master 51c785c initial

That is an interesting side effect, especially the latter BRANCH/branch one. We usually do not allow overrides of actual git commands, but this "fools" that check.

I agree it's an unexpected fallout. On the other hand, unless you are _trying_ to do something funny, I don't think you'd ever hit on this behavior. And if you are trying to do something funny, I think this behaves in a reasonable and predictable manner.

-Peff
Previous: astianNext: Junio C Hamano
Message 9 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.