hraban / tomono

Multi- To Mono-repository merge
https://tomono.0brg.net
GNU Affero General Public License v3.0
842 stars 138 forks source link

issue with annotated tags #28

Closed mwasilew2 closed 2 years ago

mwasilew2 commented 6 years ago

There seems to be an issue with migration of tags if repos contain annotated tags. I'm not sure what exactly is happening there, but it seems that the script is just moving refs/tags without updating the "tag objects in the git database" (these should only exist for annotated tags). As a result there's some unexpected behaviour, e.g. :

$ git describe
warning: tag 'my_tag' is really 'repo1/mytag' here
my_tag

one solution is to rewrite annotated tags. A simple git tag should do it. It will result in a single tag e.g. repo1/mytag, which has both objects in the git database, the new one with metadata from migration and old one with the original metadata (date, author, signing info, etc.)

I'll submit a PR with a fix, but I'll gladly hear about any other ideas

hraban commented 2 years ago

Thanks! I had written my own solution to this but yours is much better. I included the snippet in the readme, but left as an exercise to the user to actually call it, because it's a bit too invasive. Good idea though.