git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Cogito: cg-clone doesn't like packed tag objects

From
Junio C Hamano <junkio@cox.net>
Date
Sep 28, 2005, 17:22 UTC
Message-ID
<7virwlumyo.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0509271414000.3308@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 8 quoted lines
>> we could send phony entries like this:
>> 
>> b92c9c07fe2d0d89c4f692573583c4753b5355d2	deref/tags/junio-gpg-pub
>> a3eb250f996bf5e12376ec88622c4ccaabf20ea8	deref/tags/v0.99
>> 78d9d414123ad6f4f522ffecbcd9e4a7562948fd	deref/tags/v0.99.1
>
> Yes, it would work,..
> in general, it's just a really ugly special case, I think.
I think we could do this instead, to make it less ugly.

b92c9c07fe2d0d89c4f692573583c4753b5355d2 refs/tags/junio-gpg-pub!* a3eb250f996bf5e12376ec88622c4ccaabf20ea8 refs/tags/v0.99^0

I am not sure what the syntax should be, but the idea is to express the "refname" side using "extended SHA1" syntax. In the above example, I added a postfix '!*' to mean "deref tag zero-or-more times until you get a non-tag" ('!' to mean deref tag once and complain if the object is not tag, '!!' is deref twice, '!!!' is to deref three times and so on). It might be better to spell "v0.99^0" as "v0.99!*" in this context. [*1*]

Both git-clone-pack and git-fetch-pack need to be told to ignore funny tagnames with trailing '!*', otherwise they would ask for the pointed-at object (which is not harmful but redundant) and the clone would create "refs/tags/v0.99!*", a file with a funny name. Git-peek-remote should report that, and server-info.c should be told to prepare these extra entries for ls-remote over other protocols.

But I tend to agree that this is really a special case needed to support the "tagged objects are automatically followed by tags that tag them" model, and not needed if we stay in "tag is just a ref, and a ref is just an object name, and asking for an object pulls in other objects that are reachable from them" model. So it is not a very high priority for me, but I think this is one way to help Cogito cleanly, and I am willing to see how much damage this would cause to other parts of the core, *if* Cogito wants to use this mechanism.

The alternative would be what Pasky outlined in his message -- bypassing git transport layer to fetch single object by hand, repeatedly dereferencing it until he gets a non-tag. I think that is unnecessary misery for him.

[Footnote]

*1* The difference from '^0' is that '!' does not complain on non-commit, and can be used to peel the onion one layer at a time. I do not know how useful the latter is in practice but somebody may want to express chains of trust by signing tags.

Previous: Junio C HamanoNext: Junio C Hamano
Message 33 of 41 in “Cogito: cg-clone doesn't like packed tag objects”
  1. H. Peter AnvinSep 23, 2005
  2. Petr BaudisSep 24, 2005
  3. H. Peter AnvinSep 24, 2005
  4. Junio C HamanoSep 24, 2005
  5. Petr BaudisSep 24, 2005
  6. Daniel BarkalowSep 24, 2005
  7. Junio C HamanoSep 24, 2005
  8. Petr BaudisNov 9, 2005
  9. Junio C HamanoNov 9, 2005
  10. Nick HengeveldNov 9, 2005
  11. Petr BaudisNov 9, 2005
  12. Nick HengeveldNov 10, 2005
  13. Junio C HamanoNov 9, 2005
  14. Petr BaudisSep 26, 2005
  15. Brian GerstSep 26, 2005
  16. Petr BaudisSep 26, 2005
  17. Junio C HamanoSep 26, 2005
  18. Petr BaudisSep 26, 2005
  19. Junio C HamanoSep 27, 2005
  20. Tom PrinceSep 27, 2005
  21. Junio C HamanoSep 27, 2005
  22. Junio C HamanoSep 26, 2005
  23. Petr BaudisSep 27, 2005
  24. Josef WeidendorferSep 27, 2005
  25. Petr BaudisSep 27, 2005
  26. Josef WeidendorferSep 27, 2005
  27. Junio C HamanoSep 27, 2005
  28. Linus TorvaldsSep 27, 2005
  29. Junio C HamanoSep 27, 2005
  30. Linus TorvaldsSep 27, 2005
  31. Linus TorvaldsSep 27, 2005
  32. Junio C HamanoSep 27, 2005
  33. Junio C HamanoSep 28, 2005
  34. Peeling the onionJunio C Hamano, Oct 14, 2005
  35. Sven VerdoolaegeSep 27, 2005
  36. Ryan AndersonSep 27, 2005
  37. Linus TorvaldsSep 27, 2005
  38. Ryan AndersonSep 27, 2005
  39. Linus TorvaldsSep 27, 2005
  40. Junio C HamanoSep 27, 2005
  41. Junio C HamanoOct 14, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.