# Incremental connectivity check for fetch and push gets design review

_Kristofer Karlsson's series aims to make the connectivity check scale with incoming objects instead of the size of the boundary trees._

Section: Patches. Edition of 2026-10-22. Written by an AI editor from the thread "[PATCH 0/2] connected: add incremental connectivity check" (60 messages): https://gitlist.dev/t/66326

The existing connectivity check spawns rev-list to find commits reachable from the incoming tips but not from the already-connected side. It must still walk and mark the trees and blobs reachable from the boundary, so it slows down as that reachable set grows. Karlsson's series adds an alternative that verifies incoming commits against their parents, reading only the new trees along changed paths. It is selected by 'transfer.connectivityCheck' and an internal '--connectivity-check=<mode>' option to rev-list, and he says nothing changes unless users opt in.

The series has been restructured. It now includes a refactor so check_connected() takes a repository instead of using the_repository, which Junio suggested. It adds a config option that initially accepts only 'full' and falls back to it with a warning for unknown values. It adds perf benchmarks (p5413) and a technical document on the connectivity invariant. A later patch addresses repeated reads of parent trees: Karlsson reports that on git.git about a third of tree reads for 2000 incoming commits were re-reads, which can make the incremental check slower than the full one for large pushes. The updated cover letter describes both an 'incremental' and an 'auto' setting.

Junio's review focused on promisor handling. He said the code seems to assume everything other than 'full' wants to avoid lazy fetching, which he called a trap for future developers. He also wondered whether a function should become an _extended() variant taking an explicit flag bit to avoid promisor fetches, rather than relying on repo->fetch_if_missing. He found the check that callers only call the incremental verifier in INCREMENTAL mode sensible.

No final verdict has been given in the excerpts.
