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