TODOs:
- create lightweight tag
- list lightweight tags
- delete lightweight tag
- push lightweight tag
- fetch lightweight tag
- checkout lightweight tag
- create annotated tag
- read annotated tag
- ~list annotated tags~ covered by listing lightweight tags
- delete annotated tag
- push annotated tag
- fetch annotated tag
- checkout annotated tag
Implementation notes:
Writing an annotated tag parser should be trivial. Here’s what they look like. The tagger
line looks like it is the same format as author
and committer
in git commits.
object af4d84a6a9fa7a74acdad07fddf9f17ff3a974ae
type commit
tag v0.0.9
tagger Will Hilton <wmhilton@gmail.com> 1507071414 -0400
0.0.9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJZ1BW2AAoJEJYJuKWSi6a5S6EQAJQkK+wIXijDf4ZfVeP1E7Be
aDDdOLga0/gj5p2p081TLLlaKKLcYj2pub8BfFVpEmvT0QRaKaMb+wAtO5PBHTbn
y2s3dCmqqAPQa0AXrChverKomK/gUYZfFzckS8GaJTiw2RyvheXOLOEGSLTHOwy2
wjP8KxGOWfHlXZEhn/Z406OlcYMzMSL70H26pgyggSTe5RNfpXEBAgWmIAA51eEM
9tF9xuijc0mlr6vzxYVmfwat4u38nrwX7JvWp2CvD/qwILMAYGIcZqRXK5jWHemD
/x5RtUGU4cr47++FD3N3zBWx0dBiCMNUwT/v68kmhrBVX20DhcC6UX38yf1sdDfZ
yapht2+TakKQuw/T/K/6bFjoa8MIHdAx7WCnMV84M0qfMr+e9ImeH5Hj592qw4Gh
vSY80gKslkXjRnVes7VHXoL/lVDvCM2VNskWTTLGHqt+rIvSXNFGP05OGtdFYu4d
K9oFVEoRPFTRSeF/9EztyeLb/gtSdBmWP2AhZn9ip0a7rjbyv5yeayZTsedoUfe5
o8cB++UXreD+h3c/F6mTRs8aVELhQTZNZ677PY71HJKsCLbQJAd4n+gS1n8Y/7wv
Zp4YxnShDkMTV3rxZc27vehq2g9gKJzQsueLyZPJTzCHqujumiLbdYV4i4X4CZjy
dBWrLc3kdnemrlhSRzR2
=PrR1
-----END PGP SIGNATURE-----
Note that this is NOT a ‘clearsigned’ GPG document. 🙄 But rather a ‘detached’ signature concatenated on the end of the payload with an extra newline in between.
payload.txt
git tag
object af4d84a6a9fa7a74acdad07fddf9f17ff3a974ae
type commit
tag v0.0.9
tagger Will Hilton <wmhilton@gmail.com> 1507071414 -0400
0.0.9
signature.txt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJZ1BW2AAoJEJYJuKWSi6a5S6EQAJQkK+wIXijDf4ZfVeP1E7Be
aDDdOLga0/gj5p2p081TLLlaKKLcYj2pub8BfFVpEmvT0QRaKaMb+wAtO5PBHTbn
y2s3dCmqqAPQa0AXrChverKomK/gUYZfFzckS8GaJTiw2RyvheXOLOEGSLTHOwy2
wjP8KxGOWfHlXZEhn/Z406OlcYMzMSL70H26pgyggSTe5RNfpXEBAgWmIAA51eEM
9tF9xuijc0mlr6vzxYVmfwat4u38nrwX7JvWp2CvD/qwILMAYGIcZqRXK5jWHemD
/x5RtUGU4cr47++FD3N3zBWx0dBiCMNUwT/v68kmhrBVX20DhcC6UX38yf1sdDfZ
yapht2+TakKQuw/T/K/6bFjoa8MIHdAx7WCnMV84M0qfMr+e9ImeH5Hj592qw4Gh
vSY80gKslkXjRnVes7VHXoL/lVDvCM2VNskWTTLGHqt+rIvSXNFGP05OGtdFYu4d
K9oFVEoRPFTRSeF/9EztyeLb/gtSdBmWP2AhZn9ip0a7rjbyv5yeayZTsedoUfe5
o8cB++UXreD+h3c/F6mTRs8aVELhQTZNZ677PY71HJKsCLbQJAd4n+gS1n8Y/7wv
Zp4YxnShDkMTV3rxZc27vehq2g9gKJzQsueLyZPJTzCHqujumiLbdYV4i4X4CZjy
dBWrLc3kdnemrlhSRzR2
=PrR1
-----END PGP SIGNATURE-----
To verify: gpg --verify signature.txt payload.txt
To create:
gpg --armor --output signature.txt --detach-sig payload.txt
cat payload.txt signature.txt > newtag
SHA=$(git hash-object -t tag -w newtag)
echo "$SHA" > .git/refs/tags/newtag
git tag -v newtag
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
TAGS: Timeless Apparel, Getaway Style
At TAGS, we believe the journey is the destination, and are committed to bringing you timeless, well-crafted pieces to get you there in...
Read more >TAGS Gymnastics Fun, Fitness, Friends | Girls & Boys walking ...
TAGS Gymnastics will help your child develop coordination, flexibility, and strength while safely learning fun, new skills. Visit the TAGS location nearest you ......
Read more >Tag (metadata) - Wikipedia
In information systems, a tag is a keyword or term assigned to a piece of information This kind of metadata helps describe an...
Read more >tags - Amazon.com
These heavy paper key tags reinforced by aluminum rings are especially great for crafts and for use as gift tags.
Read more >About Tags - Tag Manager Help - Google Support
Tags are segments of code provided by analytics, marketing, and support vendors to help you integrate their products into your websites or mobile...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Status update:
You can fetch tags (git.fetch({…, tags: true})) and list them (git.listTags(…)). Checking out lightweight tags should work. Resolving and checking out annotated tags, and other tag operations don’t yet.
I proposed 2 issues related to tags: #519 & #520