{"thread":{"id":"53674","subject":"regenerating tags when cloning","startedAt":"2020-06-13T22:38:20Z","lastAt":"2020-06-14T09:51:23Z","messageCount":2,"participants":["Will Holcomb","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"399673","messageId":"CAB8ffCD4jO6GxRohMpsyszdvi7dmz7HzE=2aNdqBG_zOGgOCoA@mail.gmail.com","threadId":"53674","inReplyTo":null,"subject":"regenerating tags when cloning","fromName":"Will Holcomb","fromEmail":"w@dhappy.org","sentAt":"2020-06-13T22:37:41Z","receivedAt":"2020-06-13T22:38:20Z","isPatch":false,"sender":{"key":"w@dhappy.org","avatar":null},"body":"I am working on a git remote\n(https://github.com/dhappy/git-remote-ipfs), and I am confused as to\nhow to recreate signed tags when cloning.\n\nMy remote serializes the commit chain to IPFS and back. It works\ncorrectly for branches, but I'm having difficulty with tags:\n • If I recreate tags, I get the error: \"fatal: BUG: initial ref\ntransaction called with existing refs\".\n • If I don't create the tags, I get an error like: \"Error: reference\n'refs/tags/v0.3.4' not found\".\n • If I create the tags and remove the references, the clone will\ncomplete, but the resultant repo has a detached head and no tags.\n\nI created a minimum failing example when I posted to stackoverflow:\nhttps://stackoverflow.com/q/62360443/264008\n\nI can do a \"git clone --tags\" from Github, and it creates a clone with\ntags, so I know it can be done. I just don't understand what I need to\nchange.\n\nIt might be germane that I am translating the git objects into a\nCBOR-DAG: https://explore.ipld.io/#/explore/Qmcnzkb1YGyDWBqSaFz1k7qi3F1VDaHNsBWNF2SvRiYeL5/.git\nand relying on nodegit to reconstruct objects with the same SHA1\nhashes on fetch, so I can't directly insert things into the object\ndatabase.\n\nAny suggestions would be greatly appreciated.\n\n–☮W\n"},{"id":"399698","messageId":"2492579d-5104-1643-b3a9-c891a8aea045@iee.email","threadId":"53674","inReplyTo":"CAB8ffCD4jO6GxRohMpsyszdvi7dmz7HzE=2aNdqBG_zOGgOCoA@mail.gmail.com","subject":"Re: regenerating tags when cloning","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2020-06-14T09:51:18Z","receivedAt":"2020-06-14T09:51:23Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 13/06/2020 23:37, Will Holcomb wrote:\n> I am working on a git remote\n> (https://github.com/dhappy/git-remote-ipfs), and I am confused as to\n> how to recreate signed tags when cloning.\n>\n> My remote serializes the commit chain to IPFS and back. It works\n> correctly for branches, but I'm having difficulty with tags:\n>  • If I recreate tags, I get the error: \"fatal: BUG: initial ref\n> transaction called with existing refs\".\n>  • If I don't create the tags, I get an error like: \"Error: reference\n> 'refs/tags/v0.3.4' not found\".\n>  • If I create the tags and remove the references, the clone will\n> complete, but the resultant repo has a detached head and no tags.\n>\n> I created a minimum failing example when I posted to stackoverflow:\n> https://stackoverflow.com/q/62360443/264008\n>\n> I can do a \"git clone --tags\" from Github, and it creates a clone with\n> tags, so I know it can be done. I just don't understand what I need to\n> change.\n>\n> It might be germane that I am translating the git objects into a\n> CBOR-DAG: https://explore.ipld.io/#/explore/Qmcnzkb1YGyDWBqSaFz1k7qi3F1VDaHNsBWNF2SvRiYeL5/.git\n> and relying on nodegit to reconstruct objects with the same SHA1\n> hashes on fetch, so I can't directly insert things into the object\n> database.\n>\n> Any suggestions would be greatly appreciated.\nThoughts that come to mind (I know nothing about IPFS..):\n\nAre these annotated tags or lightweight tags?\nhttps://stackoverflow.com/questions/11514075/what-is-the-difference-between-an-annotated-and-unannotated-tag\n\nCan you be sure that the commits the tags reference have already been\nrecreated before you start tagging them?\n\nCould the tags have already been implicitly recreated (being mistaken\nfor a commitish object), and so you are trying to create a duplicate.\n\nIs the tag name meant to have 'fancy' symbols\nhttps://explore.ipld.io/#/explore/Qmcnzkb1YGyDWBqSaFz1k7qi3F1VDaHNsBWNF2SvRiYeL5/.git/refs/tags/%E2%93%A5/%C2%BD\n(does the clone work for similar symbols in the commit messages)?\n\nThe Git code is available at https://github.com/git/git (you probably\nalready knew that) if you want to search for the error messages and\nhence code paths.\n\nPhilip\n\n\n"}]}