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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dirk Süsserott
Date: Monday, March 24, 2008 - 6:15 am

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. ;-)

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.

Junio C Hamano schrieb:
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git-config: aliases with parameter expansion ($1 and such), Dirk Süsserott, (Sun Mar 23, 6:28 am)
Re: git-config: aliases with parameter expansion ($1 and such), Johannes Schindelin, (Sun Mar 23, 7:19 am)
Re: git-config: aliases with parameter expansion ($1 and such), Dirk Süsserott, (Mon Mar 24, 6:15 am)