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

Re: [PATCH v2 2/2] connect: advertized capability is not a ref

From
Jeff King <peff@peff.net>
Date
Sep 3, 2016, 00:56 UTC
Message-ID
<20160903005653.vzt3vel25vino7yk@sigill.intra.peff.net>
In-Reply-To
<20160902235145.GI14758@google.com>
On Fri, Sep 02, 2016 at 04:51:45PM -0700, Jonathan Nieder wrote:
Show 7 quoted lines
> > I'd be more interested in the pain of this transition if there was a
> > concrete use case for "hide literally all refs, but still allow
> > fetches". Is that a thing that people do?
> 
> Sure, it is a thing that people do.  For example I've seen replication
> systems that learn what SHA-1s to fetch out-of-band and then use this
> approach to avoid the overhead of a long ref advertisement.

I know that's how those features work. I was more wondering if it ever comes up that somebody actually has hidden refs, but _no_ non-hidden ones. Do the systems you've seen hide all the refs?

> However, that is not my motivation.  My motivation is being able to
> extend the protocol in the future.  The capabilities line has been
> important for that historically.

Sure, I agree it's a nice move forward for compatibility. But that argues for teaching the clients to handle it (for the future), and then turning it on in the server only when it becomes useful (i.e., the "in a year or so" can become "when we find a use for it").

In a similar vein, I'd think that a config to enable this in upload-pack today could have an "auto" mode, which enables it _only_ when you know something productive might come of it (namely that you have hidden refs, one of the uploadpack.allow* features is enabled, and the ref advertisement is empty). Then requests which could not benefit from it at all do not have to pay the potential compatibility cost.

> Do you have any objection to the server gaining support for this
> guarded by a configuration option?  Then when the time comes to
> consider flipping the default we can use real-world statistics about
> what git client versions people use to make an informed decision.

Guarded by config, no. It's the flipping of the default I care more about. The config is not necessary in the meantime for getting real-world statistics; you can add the config and flip the default as one unit at any time (the thing that is time-critical is teaching the client to handle _both_ cases gracefully).

The config is useful in the meantime if there are people who could benefit from it immediately, and don't mind paying the compatibility cost. With an "auto" as I described above, using that as the default seems like a decent interim behavior (i.e., why would you set up such a repository if you didn't expect most clients to use the allowTipSHA1 feature?). I'd still probably give some lag between shipping the client, and flipping the server default to "auto".

I hoped to share some numbers on what versions people are currently using against GitHub, to get a sense of how far back most people are. But I haven't been actively involved in keeping those numbers for a while, and I'm not sure what we have readily stored. I did show some numbers a few years ago[1], and it looks like about 2/3 of people were within 6-12 months of the latest version, but the rest was a long tail.

I don't know if that will have changed with the advent of more client versions (e.g., lots more people are using libgit2 now via GUI clients, Visual Studio, etc; how does it fare with the proposed change?).

-Peff
[1] http://public-inbox.org/git/20120531114801.GA21367@sigill.intra.peff.net/
Previous: Jonathan NiederNext: Junio C Hamano
Message 22 of 45 in “handle empty spec-compliant remote repos correctly”
  1. 0/2 handle empty spec-compliant remote repos correctlyJonathan Tan, Sep 2, 2016
  2. 2/2 connect: know that zero-ID is not a refJonathan Tan, Sep 2, 2016
  3. Jonathan NiederSep 2, 2016
  4. Shawn PearceSep 2, 2016
  5. Stefan BellerSep 2, 2016
  6. Shawn PearceSep 2, 2016
  7. Jeff KingSep 2, 2016
  8. Jonathan TanSep 2, 2016
  9. Jeff KingSep 2, 2016
  10. Shawn PearceSep 3, 2016
  11. Jeff KingSep 3, 2016
  12. 1/2 tests: move test_lazy_prereq JGIT to test-lib.shJonathan Tan, Sep 2, 2016
  13. 0/2 handle empty spec-compliant remote repos correctlyJonathan Tan, Sep 2, 2016
  14. 1/2 tests: move test_lazy_prereq JGIT to test-lib.shJonathan Tan, Sep 2, 2016
  15. Junio C HamanoSep 7, 2016
  16. 2/2 connect: advertized capability is not a refJonathan Tan, Sep 2, 2016
  17. Jonathan NiederSep 2, 2016
  18. Jeff KingSep 2, 2016
  19. Stefan BellerSep 2, 2016
  20. Jonathan NiederSep 3, 2016
  21. Jonathan NiederSep 2, 2016
  22. Jeff KingSep 3, 2016
  23. Junio C HamanoSep 7, 2016
  24. Junio C HamanoSep 7, 2016
  25. Jonathan NiederSep 7, 2016
  26. Junio C HamanoSep 7, 2016
  27. 0/2 handle empty spec-compliant remote repos correctlyJonathan Tan, Sep 7, 2016
  28. 1/2 tests: move test_lazy_prereq JGIT to test-lib.shJonathan Tan, Sep 7, 2016
  29. 2/2 connect: advertized capability is not a refJonathan Tan, Sep 7, 2016
  30. Jonathan NiederSep 8, 2016
  31. connect: tighten check for unexpected early hang up (Re: [PATCH v3 2/2] connect: advertized capability is not a ref)Jonathan Nieder, Sep 8, 2016
  32. Jonathan NiederSep 8, 2016
  33. Jonathan NiederSep 8, 2016
  34. Junio C HamanoSep 8, 2016
  35. Stefan BellerSep 8, 2016
  36. Junio C HamanoSep 8, 2016
  37. 0/3 handle empty spec-compliant remote repos correctlyJonathan Tan, Sep 9, 2016
  38. 1/3 tests: move test_lazy_prereq JGIT to test-lib.shJonathan Tan, Sep 9, 2016
  39. Torsten BögershausenSep 10, 2016
  40. Jeff KingSep 10, 2016
  41. 3/3 connect: advertized capability is not a refJonathan Tan, Sep 9, 2016
  42. Jonathan NiederSep 9, 2016
  43. Junio C HamanoSep 9, 2016
  44. Junio C HamanoSep 9, 2016
  45. 2/3 connect: tighten check for unexpected early hang upJonathan Tan, Sep 9, 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.