Re: [PATCH v3] Allow aliases that include other aliases
- From
Jeff King <peff@peff.net>
- Date
- Sep 6, 2018, 19:05 UTC
- Message-ID
- <20180906190511.GA23884@sigill.intra.peff.net>
- In-Reply-To
- <xmqqy3cezcz5.fsf@gitster-ct.c.googlers.com>
On Thu, Sep 06, 2018 at 11:40:14AM -0700, Junio C Hamano wrote:
Show 18 quoted lines
> 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