From: Junio C Hamano Date: Tue, 22 Mar 2011 17:35:15 GMT Subject: Re: Weird behavior of shell variables in git aliases Message-ID: <7voc53kqi4.fsf@alter.siamese.dyndns.org> In-Reply-To: <20110322111844.GA32446@sigill.intra.peff.net> Jeff King writes: >> > Oh, I should have been paying a bit more attention. I've been assuming >> > that we were turning "!anything" into { "sh", "-c", "anything", "-" } >> > followed by the user supplied arguments. > > Yeah, I think that would be more useful in general, but... > ... > Doesn't it also break a lot of other more garden-variety aliases that > rely on the automagic "$@", like: Of course, silly me. Because the most common usage of the alias mechanism is to package the command name and common options and allow tacking other command line arguments after them at runtime, and it is silly to require the user to say "$@" (i.e. 'lg = "log --oneline"' example), any alias that wants to use positional parameter should do the 'sh -c "$str" -' packaging itself. So there is nothing to fix after all; I was just confused by seeing the initial report which was just a usage error. Sorry for the noise, and thanks.