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

Re: git "tag" objects implemented - and a re-done commit

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 25, 2005, 22:05 UTC
Message-ID
<Pine.LNX.4.58.0504251457510.18901@ppc970.osdl.org>
In-Reply-To
<426D62C0.40104@zytor.com>
On Mon, 25 Apr 2005, H. Peter Anvin wrote:
> 
> It would be good if the tag object could permit junk lines before the 
> start of the header; in particular, the standard PGP/GPG signed message 
> format looks like:

No, I've already explained why git doesn't parse arbitrary junk: I want git to have 100% repeatable behaviour. And that very much means that if git doesn't understand something, it just doesn't touch it or parse it.

Here's my trivial script to generate tags in proper format. Go wild:
	#!/bin/sh
	( echo -e "object $(cat .git/HEAD)\ntype commit\ntag $1\n"; cat ) > .tmp-tag
	rm -f .tmp-tag.asc
	gpg -bsa .tmp-tag && cat .tmp-tag.asc >> .tmp-tag
	git-mktag < .tmp-tag
	rm -f .tmp-tag*
and it creates objects like this one:
	torvalds@ppc970:~/git> cat-file tag 
	ba613c023dcd03e06158caee9c0337e6b6988854
	object ec4465adb38d21966acdc9510ff15c0fe4539468
	type commit
	tag test-release
	Testing tagging
	-----BEGIN PGP SIGNATURE-----
	Version: GnuPG v1.2.4 (GNU/Linux)
	
	iD8DBQBCbVwSF3YsRnbiHLsRAliaAKCMlb6k6VAS7hxajwUtwRdzDZn9rACffVTb
	dRdDS6n+pjSAYbA6Lp11bQU=
	=JNiv
	-----END PGP SIGNATURE-----
and then you just split it at the (last occurrence of) the 
	-----BEGIN PGP SIGNATURE-----
and you can do
	torvalds@ppc970:~/git> gpg --verify tag.asc
	gpg: Signature made Mon 25 Apr 2005 02:07:30 PM PDT using DSA key ID 76E21CBB
	gpg: Good signature from "Linus Torvalds (tag signing key) <torvalds@osdl.org>"
to verify the dang thing.

And that way git never guesses anything at all, and you can use whatever you want to sign the things.

		Linus
Previous: H. Peter AnvinNext: Petr Baudis
Message 12 of 14 in “git "tag" objects implemented - and a re-done commit”
  1. Linus TorvaldsApr 25, 2005
  2. Andreas GalApr 25, 2005
  3. Linus TorvaldsApr 25, 2005
  4. Andreas GalApr 25, 2005
  5. Linus TorvaldsApr 25, 2005
  6. Linus TorvaldsApr 25, 2005
  7. SeanApr 26, 2005
  8. Ryan AndersonApr 26, 2005
  9. Matthias UrlichsApr 27, 2005
  10. Linus TorvaldsApr 27, 2005
  11. H. Peter AnvinApr 25, 2005
  12. Linus TorvaldsApr 25, 2005
  13. Petr BaudisApr 25, 2005
  14. Linus TorvaldsApr 25, 2005

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.