Re: git-config: aliases with parameter expansion ($1 and such)
Johannes Schindelin schrieb:
Show 46 quoted lines
> Hi,
>
> On Sun, 23 Mar 2008, Dirk Süsserott wrote:
>
>
>> Jay Soffian schrieb:
>>
>>> On Sun, Mar 23, 2008 at 9:28 AM, Dirk Süsserott <newsletter@dirk.my1.cc>
>>> 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"
>>>
>
> Why so complicated?
>
> atag = tag -a -m
>
> should work already.
>
> Hth,
> Dscho
Almost, but not what I want. With
atag = tag -a -m
I still have to say
$ git atag mytag mytag
But I just wanna say
$ git atag mytag
to create an annotated tag as if I've said
$ git tag -a -m "mytag" mytagDirk