Re: [PATCH v3] Allow aliases that include other aliases
- Date: Thu, 6 Sep 2018 15:05:12 -0400
- From: Jeff King <peff@xxxxxxxx>
- Subject: Re: [PATCH v3] Allow aliases that include other aliases
On Thu, Sep 06, 2018 at 11:40:14AM -0700, Junio C Hamano wrote:
> Also, normal users who have never seen this loop that implements
> alias expansion would not have a clue when they see "called twice".
> I actually think the caller should also pass cmd to run_argv() and
> then we should use it (and not argv) in this die() message. When
> the original command was foo that is aliased to bar, which in turn
> is aliased to baz, which in turn is aliased to bar, especially that
> "git foo" invocation was in a random script written six weeks ago by
> the user, it would be a lot more helpful to see
> "alias loop detected: expansion of 'git foo' does not terminate"
> "loop alias: bar is called twice".
> given that 'bar' is not something the user called, or written in the
> script she wrote six weeks ago.
Good point. I think Ævar's "print the whole list" solves that, because
items is that first element. But I agree the fundamental message
should be "loop in 'git foo'".