threads / discuss / 46748

should "git tag" option of "-a" conflict with "-s", "-u"?

Subject: should "git tag" option of "-a" conflict with "-s", "-u"?

## tl;dr

2 messages between Sep 14, 2017 and Sep 14, 2017.

replies: 1people: 2as markdown or json

Robert P. J. Day· Sep 14, 2017, 10:08 UTC · lore
  just noticed in "man git-tag":
  1)  "-a" explicitly claims to create an unsigned tag
  2)  both "-s" and "-u" both claim to create signed tags

should that mean that it should be an error to try to use "-a" in combination with either of "-u" or "-s"? the synopsis does suggest that you can use only one of those at a time:

  git tag [-a | -s | -u <keyid>] ...

but i tested with (from memory) using both "-a" and "-s", and tag actually tried to do it, but failed simply because i had no key. clearly, though, it was making the attempt.

  can someone clarify this?
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Jeff King· Sep 14, 2017, 12:15 UTC · re: Robert P. J. Day · lore

Re: should "git tag" option of "-a" conflict with "-s", "-u"?

On Thu, Sep 14, 2017 at 06:08:10AM -0400, Robert P. J. Day wrote:
Show 16 quoted lines
>   just noticed in "man git-tag":
> 
>   1)  "-a" explicitly claims to create an unsigned tag
>   2)  both "-s" and "-u" both claim to create signed tags
> 
> should that mean that it should be an error to try to use "-a" in
> combination with either of "-u" or "-s"? the synopsis does suggest
> that you can use only one of those at a time:
> 
>   git tag [-a | -s | -u <keyid>] ...
> 
> but i tested with (from memory) using both "-a" and "-s", and tag
> actually tried to do it, but failed simply because i had no key.
> clearly, though, it was making the attempt.
> 
>   can someone clarify this?

I think the documentation could be a little more clear. "-a" just asks to create a tag object, rather than a "lightweight" tag. Using "-s" asks for a signature, which requires having a tag object, and thus implies "-a".

So there's no point in using the two together (since "-s" already implies "-a"), but it also doesn't hurt to do so.

-Peff

← back to recent threads