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

Re: [PATCH v2] send-pack: never fetch when checking exclusions

From
Jeff King <peff@peff.net>
Date
Oct 11, 2019, 06:12 UTC
Message-ID
<20191011061257.GD20094@sigill.intra.peff.net>
In-Reply-To
<20191008183739.194714-1-jonathantanmy@google.com>
On Tue, Oct 08, 2019 at 11:37:39AM -0700, Jonathan Tan wrote:
Show 14 quoted lines
> When building the packfile to be sent, send_pack() is given a list of
> remote refs to be used as exclusions. For each ref, it first checks if
> the ref exists locally, and if it does, passes it with a "^" prefix to
> pack-objects. However, in a partial clone, the check may trigger a lazy
> fetch.
> 
> The additional commit ancestry information obtained during such fetches
> may show that certain objects that would have been sent are already
> known to the server, resulting in a smaller pack being sent. But this is
> at the cost of fetching from many possibly unrelated refs, and the lazy
> fetches do not help at all in the typical case where the client is
> up-to-date with the upstream of the branch being pushed.
> 
> Ensure that these lazy fetches do not occur.

That makes sense. For similar reasons, should we be using OBJECT_INFO_QUICK here? If the other side has a bunch of ref tips that we don't have, we'll end up re-scanning the pack directory over and over (which is _usually_ pretty quick, but can be slow if you have a lot of packs locally). And it's OK if we racily miss out on an exclusion due to somebody else repacking simultaneously.

-Peff
Previous: Jonathan TanNext: Derrick Stolee
Message 4 of 9 in “send-pack: never fetch when checking exclusions”
  1. send-pack: never fetch when checking exclusionsJonathan Tan, Oct 7, 2019
  2. Junio C HamanoOct 8, 2019
  3. send-pack: never fetch when checking exclusionsJonathan Tan, Oct 8, 2019
  4. Jeff KingOct 11, 2019
  5. Derrick StoleeOct 11, 2019
  6. Jeff KingOct 11, 2019
  7. Jonathan TanOct 11, 2019
  8. Jeff KingOct 17, 2019
  9. Junio C HamanoOct 12, 2019

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.