Web lists-archives.com

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




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.

>   $ 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