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"
> 
> than
> 
>     "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[0] is that first element. But I agree the fundamental message
should be "loop in 'git foo'".

-Peff

Reply via email to