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

Re: [PATCH v2 2/8] upload-pack: implement ref-in-want

From
BWBrandon Williams <bmwill@google.com>
Date
Jun 19, 2018, 18:50 UTC
Message-ID
<20180619185033.GC199585@google.com>
In-Reply-To
<xmqq602jzriy.fsf@gitster-ct.c.googlers.com>
On 06/15, Junio C Hamano wrote:
Show 28 quoted lines
> The story would be different if your request were 
> 
> 	git fetch refs/heads/*:refs/remotes/origin/*
> 
> in which case, you are not even saying "I want this and that ref";
> you are saying "all refs in refs/heads/* whoever ends up serving me
> happens to have".  You may initially contact one of my friends and
> learn that there are 'master' and 'bo' branches (and probably
> others), and after conversation end up talking with me who is stale
> and lack 'bo'.  In such a case, I agree that it is not sensible for
> me to fail the request as a whole and instead serve you whatever
> branches I happen to have.  I may lack 'bo' branch due to mirroring
> lag, but I may also have 'extra' branch that others no longer have
> due to mirroring lag of deletion of that branch!
> 
> But then I think your "git fetch refs/heads/*:refs/remotes/origin/*"
> should not fail not just because I do not have 'bo', but you also
> should grab other old branches I have, which you didn't hear about
> when you made the initial contact with my friend in the mirror pool.
> 
> So, given that, would it make sense for 'want-ref <ref>' request to
> name "a particular ref" as the above document says?  I have a
> feeling that it should allow a pattern to be matched at the server
> side (and it is not an error if the pattern did not match anything),
> in addition to asking for a particular ref (in which case, lack of
> that ref should be a hard failure, at least for the mirror that ends
> up serving the packfile and the final "here are the refs your
> request ended up fetching, with their values").

After some more in-office discussion about this I think I should revert back to making it a hard failure when a client requests a ref which doesn't exist on the server. This makes things more consistent with what happens today if I request a non-existent ref (Although that error is purely on the client). Its no worse than we have today and even with this solution not solving the issues of new/deleted refs (which are rare operations wrt updates) we still can get the benefit of not failing due to a ref updating. This is also very valuable for the servers which have to to ACL checks on individual ref names.

I also think that we should keep this first implementation of ref-in-want simple and *not* include patterns, even if that's what we may want someday down the road. Adding a new capability in the future for support of such patterns would be relatively simple and easy. The reason why I don't think we should add pattern support just yet is due to a request for "want-ref refs/tags/*" or a like request resulting in a larger than expected packfile every time "fetch --tags" is run. The issue being that in a fetch request "refs/tags/*" is too broad of a request and could be requesting 100s of tags when all we really wanted was to get the one or two new tags which are present on the remote (because we already have all the other tags present locally).

So I think the best way is to limit these patterns to the ls-refs request where we can then discover the few tags we're missing and then request just those tags explicitly, keeping the resulting packfile smaller.

Thoughts?
-- 
Brandon Williams
Previous: Junio C HamanoNext: Junio C Hamano
Message 24 of 122 in “ref-in-want”
  1. 0/8 ref-in-wantBrandon Williams, Jun 5, 2018
  2. 3/8 upload-pack: test negotiation with changing repositoryBrandon Williams, Jun 5, 2018
  3. 4/8 fetch: refactor the population of peer ref OIDsBrandon Williams, Jun 5, 2018
  4. 6/8 fetch: refactor to make function args narrowerBrandon Williams, Jun 5, 2018
  5. 8/8 fetch-pack: implement ref-in-wantBrandon Williams, Jun 5, 2018
  6. 7/8 fetch-pack: put shallow info in output parameterBrandon Williams, Jun 5, 2018
  7. 5/8 fetch: refactor fetch_refs into two functionsBrandon Williams, Jun 5, 2018
  8. 1/8 test-pkt-line: add unpack-sideband subcommandBrandon Williams, Jun 5, 2018
  9. 2/8 upload-pack: implement ref-in-wantBrandon Williams, Jun 5, 2018
  10. Ramsay JonesJun 5, 2018
  11. Ævar Arnfjörð BjarmasonJun 5, 2018
  12. Brandon WilliamsJun 6, 2018
  13. Ævar Arnfjörð BjarmasonJun 6, 2018
  14. Brandon WilliamsJun 6, 2018
  15. 0/8 ref-in-wantBrandon Williams, Jun 13, 2018
  16. 1/8 test-pkt-line: add unpack-sideband subcommandBrandon Williams, Jun 13, 2018
  17. Stefan BellerJun 14, 2018
  18. Brandon WilliamsJun 14, 2018
  19. 2/8 upload-pack: implement ref-in-wantBrandon Williams, Jun 13, 2018
  20. Stefan BellerJun 14, 2018
  21. Brandon WilliamsJun 14, 2018
  22. Junio C HamanoJun 15, 2018
  23. Junio C HamanoJun 15, 2018
  24. Brandon WilliamsJun 19, 2018
  25. Junio C HamanoJun 19, 2018
  26. Brandon WilliamsJun 19, 2018
  27. Junio C HamanoJun 21, 2018
  28. 4/8 fetch: refactor the population of peer ref OIDsBrandon Williams, Jun 13, 2018
  29. 3/8 upload-pack: test negotiation with changing repositoryBrandon Williams, Jun 13, 2018
  30. Stefan BellerJun 14, 2018
  31. 5/8 fetch: refactor fetch_refs into two functionsBrandon Williams, Jun 13, 2018
  32. 8/8 fetch-pack: implement ref-in-wantBrandon Williams, Jun 13, 2018
  33. Stefan BellerJun 14, 2018
  34. Brandon WilliamsJun 14, 2018
  35. Jonathan NiederJun 22, 2018
  36. 7/8 fetch-pack: put shallow info in output parameterBrandon Williams, Jun 13, 2018
  37. Stefan BellerJun 14, 2018
  38. Jonathan TanJun 14, 2018
  39. Brandon WilliamsJun 19, 2018
  40. 6/8 fetch: refactor to make function args narrowerBrandon Williams, Jun 13, 2018
  41. Stefan BellerJun 14, 2018
  42. Junio C HamanoJun 15, 2018
  43. Brandon WilliamsJun 18, 2018
  44. 0/8 ref-in-wantBrandon Williams, Jun 20, 2018
  45. 1/8 test-pkt-line: add unpack-sideband subcommandBrandon Williams, Jun 20, 2018
  46. Jonathan NiederJun 22, 2018
  47. 2/8 upload-pack: implement ref-in-wantBrandon Williams, Jun 20, 2018
  48. Jonathan TanJun 25, 2018
  49. Jonathan TanJun 25, 2018
  50. Brandon WilliamsJun 25, 2018
  51. 3/8 upload-pack: test negotiation with changing repositoryBrandon Williams, Jun 20, 2018
  52. 4/8 fetch: refactor the population of peer ref OIDsBrandon Williams, Jun 20, 2018
  53. Jonathan TanJun 25, 2018
  54. 5/8 fetch: refactor fetch_refs into two functionsBrandon Williams, Jun 20, 2018
  55. Jonathan NiederJun 22, 2018
  56. Jonathan NiederJun 22, 2018
  57. 6/8 fetch: refactor to make function args narrowerBrandon Williams, Jun 20, 2018
  58. 8/8 fetch-pack: implement ref-in-wantBrandon Williams, Jun 20, 2018
  59. Jonathan NiederJun 22, 2018
  60. Brandon WilliamsJun 25, 2018
  61. 7/8 fetch-pack: put shallow info in output parameterBrandon Williams, Jun 20, 2018
  62. Jonathan TanJun 25, 2018
  63. Brandon WilliamsJun 25, 2018
  64. 0/8 ref-in-wantBrandon Williams, Jun 25, 2018
  65. 1/8 test-pkt-line: add unpack-sideband subcommandBrandon Williams, Jun 25, 2018
  66. 2/8 upload-pack: implement ref-in-wantBrandon Williams, Jun 25, 2018
  67. 4/8 fetch: refactor the population of peer ref OIDsBrandon Williams, Jun 25, 2018
  68. 5/8 fetch: refactor fetch_refs into two functionsBrandon Williams, Jun 25, 2018
  69. 6/8 fetch: refactor to make function args narrowerBrandon Williams, Jun 25, 2018
  70. Jonathan TanJun 25, 2018
  71. 7/8 fetch-pack: put shallow info in output parameterBrandon Williams, Jun 25, 2018
  72. 8/8 fetch-pack: implement ref-in-wantBrandon Williams, Jun 25, 2018
  73. 3/8 upload-pack: test negotiation with changing repositoryBrandon Williams, Jun 25, 2018
  74. Jonathan TanJun 25, 2018
  75. Jonathan TanJun 25, 2018
  76. 0/8 ref-in-wantBrandon Williams, Jun 26, 2018
  77. 1/8 test-pkt-line: add unpack-sideband subcommandBrandon Williams, Jun 26, 2018
  78. 2/8 upload-pack: implement ref-in-wantBrandon Williams, Jun 26, 2018
  79. Junio C HamanoJun 26, 2018
  80. Brandon WilliamsJun 27, 2018
  81. Junio C HamanoJun 27, 2018
  82. Brandon WilliamsJun 27, 2018
  83. Stefan BellerJun 27, 2018
  84. Jonathan TanJun 27, 2018
  85. 5/8 fetch: refactor fetch_refs into two functionsBrandon Williams, Jun 26, 2018
  86. 4/8 fetch: refactor the population of peer ref OIDsBrandon Williams, Jun 26, 2018
  87. 3/8 upload-pack: test negotiation with changing repositoryBrandon Williams, Jun 26, 2018
  88. Junio C HamanoJun 26, 2018
  89. Brandon WilliamsJun 27, 2018
  90. Jonathan TanJun 27, 2018
  91. 8/8 fetch-pack: implement ref-in-wantBrandon Williams, Jun 26, 2018
  92. Jonathan TanJun 27, 2018
  93. Brandon WilliamsJun 27, 2018
  94. 7/8 fetch-pack: put shallow info in output parameterBrandon Williams, Jun 26, 2018
  95. Junio C HamanoJun 26, 2018
  96. Brandon WilliamsJun 27, 2018
  97. 6/8 fetch: refactor to make function args narrowerBrandon Williams, Jun 26, 2018
  98. Junio C HamanoJun 26, 2018
  99. 0/8 ref-in-wantBrandon Williams, Jun 27, 2018
  100. 1/8 test-pkt-line: add unpack-sideband subcommandBrandon Williams, Jun 27, 2018
  101. 2/8 upload-pack: implement ref-in-wantBrandon Williams, Jun 27, 2018
  102. 3/8 upload-pack: test negotiation with changing repositoryBrandon Williams, Jun 27, 2018
  103. 5/8 fetch: refactor fetch_refs into two functionsBrandon Williams, Jun 27, 2018
  104. 4/8 fetch: refactor the population of peer ref OIDsBrandon Williams, Jun 27, 2018
  105. 7/8 fetch-pack: put shallow info in output parameterBrandon Williams, Jun 27, 2018
  106. 6/8 fetch: refactor to make function args narrowerBrandon Williams, Jun 27, 2018
  107. 8/8 fetch-pack: implement ref-in-wantBrandon Williams, Jun 27, 2018
  108. Duy NguyenJul 22, 2018
  109. Brandon WilliamsJul 23, 2018
  110. Duy NguyenJul 23, 2018
  111. Jonathan NiederJul 23, 2018
  112. fetch-pack: mark die strings for translationBrandon Williams, Jul 23, 2018
  113. Stefan BellerJul 23, 2018
  114. Jonathan NiederJul 23, 2018
  115. Junio C HamanoJul 23, 2018
  116. Junio C HamanoJul 23, 2018
  117. Brandon WilliamsJul 23, 2018
  118. Jonathan TanJun 15, 2018
  119. Brandon WilliamsJun 19, 2018
  120. Jonathan TanJun 19, 2018
  121. Brandon WilliamsJun 19, 2018
  122. Jonathan TanJun 19, 2018

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.