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

Re: [PATCH] fetch: pass transport to post-fetch connectivity check

From
Jeff King <peff@peff.net>
Date
May 27, 2026, 08:32 UTC
Message-ID
<20260527083216.GA981444@coredump.intra.peff.net>
In-Reply-To
<pull.2123.git.1779625693328.gitgitgadget@gmail.com>
On Sun, May 24, 2026 at 12:28:12PM +0000, Kristofer Karlsson via GitGitGadget wrote:
Show 15 quoted lines
> From: Kristofer Karlsson <krka@spotify.com>
> 
> When fetching with a transport that sets `self_contained_and_connected`
> (as index-pack does for self-contained packs), check_connected() can
> use find_pack_entry_one() to skip connectivity verification for refs
> whose objects exist in the new pack. This avoids sending those OIDs to
> the rev-list child process.
> 
> However, store_updated_refs() never passed the transport to
> check_connected(), so opt.transport was always NULL and this
> optimization was dead code for post-fetch connectivity checks.
> 
> Thread the transport parameter through store_updated_refs() and set
> opt.transport so that check_connected() can take advantage of
> self-contained packs.

That makes sense in principle, but one thing puzzles me. We only turn on the optimization in check_connected() if the transport's smart_options has the self_contained_and_connected bit set. And we set that only when we were told via check_self_contained_and_connected to do so (and we pass the appropriate option to index-pack, which tells us the result is OK).

And the only place that turns on check_self_contained_and_connected is in builtin/clone.c. So how does this optimization work for a non-clone fetch? Am I missing some code path?

-Peff
Previous: Kristofer KarlssonNext: Kristofer Karlsson
Message 4 of 6 in “fetch: pass transport to post-fetch connectivity check”
  1. fetch: pass transport to post-fetch connectivity checkKristofer Karlsson via GitGitGadget, May 24, 2026
  2. Junio C HamanoMay 24, 2026
  3. Kristofer KarlssonMay 24, 2026
  4. Jeff KingMay 27, 2026
  5. Kristofer KarlssonMay 27, 2026
  6. Jeff KingMay 27, 2026

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.