Re: [RFC PATCH v4 1/3] Add support for nested aliases
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 17, 2018, 15:37 UTC
- Message-ID
- <xmqqva7487a2.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <aede75a5-d2ba-5a95-434d-aa70f7270fd7@gmx.de>
Tim Schumacher <timschumi@gmx.de> writes:
Show 13 quoted lines
> On 08.09.18 15:28, Duy Nguyen wrote: >> On Sat, Sep 8, 2018 at 12:44 AM Tim Schumacher <timschumi@gmx.de> wrote: >>> + /* >>> + * It could be an alias -- this works around the insanity >>> * of overriding "git log" with "git show" by having >>> * alias.log = show >>> */ >> >> I think this comment block is about the next two lines you just >> deleted. So delete it to instead of fixing style. > > I think that comment is talking about the code that is handing the alias, > so it still would be valid.
"this" in "this works around" refers to the fact that we first check the builtins and on-GIT_EXEC_PATH commands before trying an alias, which is an effective way to forbid an alias from taking over existing command names. So it is not about a particular code but is about how the two sections of code are laid out.
It probably will make it clear if we reworded and made it a comment about the whole while() loop may make sense, i.e.
/*
* Check if av[0] is a command before seeing if it is an
* alias to avoid the insanity of overriding ...
*/
while (1) {
...but that can be done after the dust settles as a clean-up, I would think.