Closed mwasilew2 closed 2 years ago
@markbarlow You probably need to add the --tags
flag to git fetch
or else you won't fetch the annotated tags.
I didn't get why do you need to rewrite the annotated tags, can you explain ?
Annotated tags contain their own tag name in the object. E.g.:
mpb1806:~ hraban$ cd /tmp
mpb1806:tmp hraban$ mkdir foo
mpb1806:tmp hraban$ cd foo
mpb1806:foo hraban$ git init
Initialized empty Git repository in /private/tmp/foo/.git/
mpb1806:foo hraban$ git commit --allow-empty -m commit
[master (root-commit) d663448] commit
mpb1806:foo hraban$ git tag -a mytag
... edit tag commit message ....
mpb1806:foo hraban$ cat .git/refs/tags/mytag
13e259f0fcf2ed625c51159c39debf1953ae5fb0
mpb1806:foo hraban$ git cat-file -p 13e259f0fcf2ed625c51159c39debf1953ae5fb0
object d663448a55382c3305039220621ab1ad41ddb541
type commit
tag mytag
tagger Hraban Luyat <hraban@0brg.net> 1534168639 +0100
This is mytag
an annotated tag is a full git object with the tagname (see the tag mytag
line) in it. If you later rename tags, you need to change that in the object itself.
I'm not familiar enough with annotated tags to know if the signature includes the object body itself, though.. because if so, it seems this would invalidate the signature? and you would need the original key back?
@mwasilew2 do you know if that's the case?
btw, thanks for the PR @mwasilew2 — I'll have a proper look later this week.
@hraban Thanks for the response, on my side I wanted to retrieve annotated tags also, and having git fetch --tags
at line 109 did the trick from what I experienced.
This PR was automatically closed because I pushed a new commit to master with entirely unrelated history to this original base.
The original diff is here: https://github.com/hraban/tomono/compare/v1...mwasilew2:28-issue-with-annotated-tags
I have adapted it slightly and included it in the README, instead of in the script itself, so people can run it manually if they want. See #28.
All in all, great idea, thanks again.
Signed-off-by: Michal Wasilewski mwasilewski@gmx.com