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:04:50PM +0100, Dirk Süsserott wrote:

>> atag = !git tag -a -m "$1"
> Thanks for the quick reply. Did you try that out? I did
>
> $ git atag foo
>
> with your definition and got a tag with message "$1" and
> the tag's name was "'foo'" (surrounded by single quotes).

If you want to use positional parameters, you have to invoke the shell
explicitly. Try:

  [alias]
    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].

-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