git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* regenerating tags when cloning
@ 2020-06-13 22:37 Will Holcomb
  2020-06-14  9:51 ` Philip Oakley
  0 siblings, 1 reply; 2+ messages in thread
From: Will Holcomb @ 2020-06-13 22:37 UTC (permalink / raw)
  To: git

I am working on a git remote
(https://github.com/dhappy/git-remote-ipfs), and I am confused as to
how to recreate signed tags when cloning.

My remote serializes the commit chain to IPFS and back. It works
correctly for branches, but I'm having difficulty with tags:
 • If I recreate tags, I get the error: "fatal: BUG: initial ref
transaction called with existing refs".
 • If I don't create the tags, I get an error like: "Error: reference
'refs/tags/v0.3.4' not found".
 • If I create the tags and remove the references, the clone will
complete, but the resultant repo has a detached head and no tags.

I created a minimum failing example when I posted to stackoverflow:
https://stackoverflow.com/q/62360443/264008

I can do a "git clone --tags" from Github, and it creates a clone with
tags, so I know it can be done. I just don't understand what I need to
change.

It might be germane that I am translating the git objects into a
CBOR-DAG: https://explore.ipld.io/#/explore/Qmcnzkb1YGyDWBqSaFz1k7qi3F1VDaHNsBWNF2SvRiYeL5/.git
and relying on nodegit to reconstruct objects with the same SHA1
hashes on fetch, so I can't directly insert things into the object
database.

Any suggestions would be greatly appreciated.

–☮W

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: regenerating tags when cloning
  2020-06-13 22:37 regenerating tags when cloning Will Holcomb
@ 2020-06-14  9:51 ` Philip Oakley
  0 siblings, 0 replies; 2+ messages in thread
From: Philip Oakley @ 2020-06-14  9:51 UTC (permalink / raw)
  To: Will Holcomb, git

On 13/06/2020 23:37, Will Holcomb wrote:
> I am working on a git remote
> (https://github.com/dhappy/git-remote-ipfs), and I am confused as to
> how to recreate signed tags when cloning.
>
> My remote serializes the commit chain to IPFS and back. It works
> correctly for branches, but I'm having difficulty with tags:
>  • If I recreate tags, I get the error: "fatal: BUG: initial ref
> transaction called with existing refs".
>  • If I don't create the tags, I get an error like: "Error: reference
> 'refs/tags/v0.3.4' not found".
>  • If I create the tags and remove the references, the clone will
> complete, but the resultant repo has a detached head and no tags.
>
> I created a minimum failing example when I posted to stackoverflow:
> https://stackoverflow.com/q/62360443/264008
>
> I can do a "git clone --tags" from Github, and it creates a clone with
> tags, so I know it can be done. I just don't understand what I need to
> change.
>
> It might be germane that I am translating the git objects into a
> CBOR-DAG: https://explore.ipld.io/#/explore/Qmcnzkb1YGyDWBqSaFz1k7qi3F1VDaHNsBWNF2SvRiYeL5/.git
> and relying on nodegit to reconstruct objects with the same SHA1
> hashes on fetch, so I can't directly insert things into the object
> database.
>
> Any suggestions would be greatly appreciated.
Thoughts that come to mind (I know nothing about IPFS..):

Are these annotated tags or lightweight tags?
https://stackoverflow.com/questions/11514075/what-is-the-difference-between-an-annotated-and-unannotated-tag

Can you be sure that the commits the tags reference have already been
recreated before you start tagging them?

Could the tags have already been implicitly recreated (being mistaken
for a commitish object), and so you are trying to create a duplicate.

Is the tag name meant to have 'fancy' symbols
https://explore.ipld.io/#/explore/Qmcnzkb1YGyDWBqSaFz1k7qi3F1VDaHNsBWNF2SvRiYeL5/.git/refs/tags/%E2%93%A5/%C2%BD
(does the clone work for similar symbols in the commit messages)?

The Git code is available at https://github.com/git/git (you probably
already knew that) if you want to search for the error messages and
hence code paths.

Philip



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-14  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-13 22:37 regenerating tags when cloning Will Holcomb
2020-06-14  9:51 ` Philip Oakley

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).