Re: Weird behavior of shell variables in git aliases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> 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.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]