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

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

 



Jay Soffian schrieb:
On Sun, Mar 23, 2008 at 9:28 AM, Dirk Süsserott <newsletter@xxxxxxxxxxx> wrote:
Hi, I've a question concerning git config and the alias things.
 I'd like to create an alias 'atag' that creates an annotated
 tag with the message being the same as the tag. Usually I create
 annotated tags like this:

 $ git tag -a -m "mytag" mytag

 (BTW: It's not documented, but I have the impression that
 the '-a' switch is implicitely added when the '-m' switch
 is present. Is that true?)

 I'd like to have an alias like this:

 [alias]
    atag = tag -a -m "$1"

 So that I can simply call

 $ git atag mytag

 Is it possible to pass parameters to the alias definition?
 With the definition above I got a tag with message "$1".

atag = !git tag -a -m "$1"

j.
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 tried it and it worked (with linux), then it might
be a problem with my environment: I'm using Git with windows
and the bash (Git-1.5.4-preview20080202.exe). Usually that
works very good, but sometimes it doesn't. Probably this
is one of the few "it doesn't" things.

Dirk
--
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