Re: git-config: aliases with parameter expansion ($1 and such)

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

 



On Sun, Mar 23, 2008 at 03:38:42PM -0400, Jeff King wrote:

>     atag = !sh -c 'git tag -a -m "$0" "$0"'
> 
> As an aside, this should be "$1" but it looks like we don't pass the
> shell a proper argv[0].

Hmm, I take it back. Git is doing the right thing, but it is a quirk of
the shell that it counts the first argument as the "name of the script"
even though the script actually comes from "-c".

  $ sh -c 'echo $0' foo
  foo
  $ echo 'echo $0' | sh
  sh

-Peff
--
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]

  Powered by Linux