git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dirk Süsserott" <newsletter@dirk.my1.cc>
To: Git Mailing List <git@vger.kernel.org>
Subject: Re: git-config: aliases with parameter expansion ($1 and such)
Date: Sun, 23 Mar 2008 15:04:50 +0100	[thread overview]
Message-ID: <47E66382.5030800@dirk.my1.cc> (raw)
In-Reply-To: <76718490803230645k13471472sc99932563b0239da@mail.gmail.com>

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

  reply	other threads:[~2008-03-23 14:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-23 13:28 git-config: aliases with parameter expansion ($1 and such) Dirk Süsserott
2008-03-23 13:45 ` Jay Soffian
2008-03-23 14:04   ` Dirk Süsserott [this message]
2008-03-23 14:19     ` Johannes Schindelin
2008-03-23 14:31       ` Dirk Süsserott
2008-03-23 19:38       ` Jeff King
2008-03-23 19:38     ` Jeff King
2008-03-23 19:45       ` Jeff King
2008-03-24  1:54         ` Jay Soffian
2008-03-24  2:47           ` Junio C Hamano
2008-03-24 13:15             ` Dirk Süsserott
2008-03-24 19:29               ` Jeff King
2008-03-24 14:54             ` Jay Soffian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47E66382.5030800@dirk.my1.cc \
    --to=newsletter@dirk.my1.cc \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).