All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Dirk Süsserott" <newsletter@dirk.my1.cc>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git-config: aliases with parameter expansion ($1 and such)
Date: Mon, 24 Mar 2008 15:29:52 -0400	[thread overview]
Message-ID: <20080324192952.GD14002@coredump.intra.peff.net> (raw)
In-Reply-To: <47E7A969.8010405@dirk.my1.cc>

On Mon, Mar 24, 2008 at 02:15:21PM +0100, Dirk Süsserott wrote:

> Thanks for the help. Both
>    (1) atag = !sh -c 'git tag -a -m "$0" "$0"'
> and
>    (2) atag = !sh -c 'git tag -a -m "$1" "$1"' -
> work, but in the latter case the '-' is indeed crucial.
> If not given, $1 is not set and git tag complains badly.
> When called without any args, (1) sets a tag called "sh"
> whereas (2) complains about the missing value for the -m option.
> So I decided to use the second form. Shells are funny things. ;-)

I hadn't thought of that when I gave (1) as an example. I think (2) is
clearly superior for that reason.

> BTW: Is it true that "-a" is implicitely added to "git tag"
> when the "-m" switch is present, i.e. are
>    $ git tag -m foo foo
> and
>    $ git tag -a -m foo foo
> equivalent? Thought so, but it's not in the docs.

Yes, see builtin-tag:430-433 (it is also implied by -F). Care to submit
a documentation patch?

-Peff

  reply	other threads:[~2008-03-24 19:30 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
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 [this message]
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=20080324192952.GD14002@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=newsletter@dirk.my1.cc \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.