Re: Weird behavior of shell variables in git aliases
- From
Lasse Makholm <lasse.makholm@gmail.com>
- Date
- Mar 22, 2011, 12:59 UTC
- Message-ID
- <AANLkTi=E3p8ue=-4LLiu4xFEXmC4gpa9moq=T2fQGJwR@mail.gmail.com>
- In-Reply-To
- <20110322112832.GB32446@sigill.intra.peff.net>
On 22 March 2011 12:28, Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
> $ grep -B1 silly .git/config
> [alias]
> silly = "!foo() { echo hello $1; echo $# args, bye!\n}\nfoo"
>
> which unsurprisingly looks like exactly the same solution one would use
> in the shell to avoid the fact that shell aliases suck for handling
> positional parameters.Atually, I think that's probably the most elegant way of dealing with the issue... An example like this would be very useful in the alias documentation along with an explanation on how positional parameters are handled...
-- /Lasse