git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] tag-ref and tag object binding

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 26, 2016, 22:44 UTC
Message-ID
<xmqq1t94arkx.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160126202651.GA1090@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 19 quoted lines
>> I don't think that an addition like this would get in the way of any
>> existing git workflow, and should be backwards-compatible right?
>
> Doesn't this already exist?
>
>   $ git cat-file tag v2.0.0
>   object e156455ea49124c140a67623f22a393db62d5d98
>   type commit
>   tag v2.0.0
>   tagger Junio C Hamano <gitster@pobox.com> 1401300269 -0700
>
>   Git 2.0
>   -----BEGIN PGP SIGNATURE-----
>   [...]
>   -----END PGP SIGNATURE-----
>
> Tag objects already have a "tag" header, which is part of the signed
> content. If you use "git verify-tag -v", you can check both that the
> signature is valid and that the tag is the one you are expecting.

Another thing worth mentioning is that "fsck" does not insist that refs/tags/$NAME must have a "tag" line that says "tag $NAME", and that is a very deliberate design decision. A project may want to allow multiple people tag the same commit with the same tagname and publish all of them in the same ref hierarchy. For example, while I am away, Peff may make an emergency maintenance release and tag it like so:

    $ git tag -s -m 'Git v2.7.1' v2.7.1 master
    $ git push $there tags/v2.7.1:tags/peff/v2.7.1 master

and announce to the list that he has cut a release, and published his signed tag as peff/v2.7.1 in the public repository. While everybody in the project trusts Peff as much as they trust me, I would still want to sign the same commit myself, endorsing what Peff did for the project, when I come back, by doing something like:

    $ git tag -s -m 'Git v2.7.1' v2.7.1 peff/v2.7.1^0
    $ git push $there v2.7.1

In fact, I think "git describe" uses the name recorded in the closest tag, not the refname such a tag is found at, when giveing a name to the commit. E.g.

    $ git tag foo v2.7.0
    $ git tag -d v2.7.0
    $ git describe master
    warning: tag 'v2.7.0' is really 'foo' here
    v2.7.0-170-ge572fef
Previous: Santiago TorresNext: Michael J Gruber
Message 8 of 17 in “[RFC] tag-ref and tag object binding”
  1. Santiago TorresJan 25, 2016
  2. Michael J GruberJan 26, 2016
  3. Santiago TorresJan 26, 2016
  4. Jeff KingJan 26, 2016
  5. Junio C HamanoJan 26, 2016
  6. Santiago TorresJan 28, 2016
  7. Santiago TorresJan 26, 2016
  8. Junio C HamanoJan 26, 2016
  9. Michael J GruberJan 27, 2016
  10. Jeff KingJan 27, 2016
  11. Michael J GruberJan 27, 2016
  12. Jeff KingJan 27, 2016
  13. Michael J GruberJan 27, 2016
  14. Junio C HamanoJan 27, 2016
  15. Michael J GruberJan 27, 2016
  16. Jeff KingJan 27, 2016
  17. Santiago TorresJan 28, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.