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

Re: Regarding "git log" on "git series" metadata

From
Jeff King <peff@peff.net>
Date
Nov 4, 2016, 19:49 UTC
Message-ID
<20161104194907.3yxu2rkayfyic4dr@sigill.intra.peff.net>
In-Reply-To
<CA+P7+xq0LLFBJRNNvCMQ4QR7XBg9H7NSsifiqOYqr+PUBqYRGQ@mail.gmail.com>
On Fri, Nov 04, 2016 at 12:19:55PM -0700, Jacob Keller wrote:
Show 7 quoted lines
> I agree with your assessment here. The main difficulty in implementing
> gitrefs is to ensure that they actually do get picked up by
> reachability checks to prevent dropping commits. I'm not sure how easy
> this is, but I would much rather we go this route rather than
> continuing along with the hack. This seems like the ideal solution,
> since it solves the entire problem and doesn't need more hacks bolted
> on.

I think the main complication is that the reachability rules are used during object transfer. So you'd probably want to introduce some protocol extension to say "I understand gitrefs", so that when one side says "I have sha1 X and its reachable objects", we know whether they are including gitrefs there. And likewise receivers with transfer.fsckObjects may complain about the new gitref tree mode (fortunately a new object type shouldn't be needed).

You might also want fallback rules for storing gitrefs on "old" servers (e.g., backfilling gitrefs you need if the server didn't them in the initial fetch). But I guess storing any gitrefs on such a server is inherently dangerous, because the server might prune them at any time.

So perhaps a related question is: how can gitrefs be designed such that existing servers reject them (rather than accepting the push and then later throwing away half the data). It would be easy to notice in the client during a push that we are sending gitrefs to a server which does not claim that capability. But it seems more robust if it is the server who decides "I will not accept these bogus objects".

I haven't thought all that hard about this. That's just my initial thoughts on what sound hard. Tweaking the reachability code doesn't seem all that bad; we already know all of the spots that care about S_ISGITLINK(). It may even be that some of those spots work out of the box (because gitlinks are usually about telling the graph-walking code that we _don't_ care about reachability; we do by default for trees and blobs).

I'd be surprised if all such sites work out of the box, though. Even if they see "ah, sha1 X is referenced by tree Y and isn't a gitlink, and therefore should be reachable", they need to also note that "X" is a commit and recursively walk its objects.

-Peff
Previous: Jacob KellerNext: Josh Triplett
Message 3 of 35 in “Regarding "git log" on "git series" metadata”
  1. Junio C HamanoNov 4, 2016
  2. Jacob KellerNov 4, 2016
  3. Jeff KingNov 4, 2016
  4. Josh TriplettNov 4, 2016
  5. Jacob KellerNov 4, 2016
  6. Josh TriplettNov 4, 2016
  7. Jacob KellerNov 4, 2016
  8. Jeff KingNov 5, 2016
  9. Josh TriplettNov 5, 2016
  10. Jeff KingNov 5, 2016
  11. Junio C HamanoNov 5, 2016
  12. Jeff KingNov 5, 2016
  13. Junio C HamanoNov 5, 2016
  14. Christian CouderNov 4, 2016
  15. Josh TriplettNov 4, 2016
  16. Christian CouderNov 4, 2016
  17. Stefano ZacchiroliNov 13, 2016
  18. Christian CouderNov 5, 2016
  19. Junio C HamanoNov 5, 2016
  20. Christian CouderNov 5, 2016
  21. Christian CouderNov 5, 2016
  22. Josh TriplettNov 5, 2016
  23. Christian CouderNov 5, 2016
  24. Josh TriplettNov 5, 2016
  25. Jacob KellerNov 6, 2016
  26. Josh TriplettNov 6, 2016
  27. Junio C HamanoNov 6, 2016
  28. Josh TriplettNov 6, 2016
  29. Jacob KellerNov 6, 2016
  30. Josh TriplettNov 7, 2016
  31. Jacob KellerNov 7, 2016
  32. Duy NguyenNov 7, 2016
  33. Josh TriplettNov 7, 2016
  34. Junio C HamanoNov 9, 2016
  35. Josh TriplettNov 4, 2016

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.