]> git.ipfire.org Git - thirdparty/git.git/commit
backfill: basic functionality and tests
authorDerrick Stolee <derrickstolee@github.com>
Mon, 3 Feb 2025 17:11:04 +0000 (17:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Feb 2025 00:12:41 +0000 (16:12 -0800)
commit1e72e889e722af06c2bd17b92becbc123c3b84c5
tree7895c8e4ef27032691c0a6410d9e31d6944dcad6
parenta3f79e9abdbdb27308ac7e3d9e362bcc361cecdc
backfill: basic functionality and tests

The default behavior of 'git backfill' is to fetch all missing blobs that
are reachable from HEAD. Document and test this behavior.

The implementation is a very simple use of the path-walk API, initializing
the revision walk at HEAD to start the path-walk from all commits reachable
from HEAD. Ignore the object arrays that correspond to tree entries,
assuming that they are all present already.

The path-walk API provides lists of objects in batches according to a
common path, but that list could be very small. We want to balance the
number of requests to the server with the ability to have the process
interrupted with minimal repeated work to catch up in the next run.
Based on some experiments (detailed in the next change) a minimum batch
size of 50,000 is selected for the default.

This batch size is a _minimum_. As the path-walk API emits lists of blob
IDs, they are collected into a list of objects for a request to the
server. When that list is at least the minimum batch size, then the
request is sent to the server for the new objects. However, the list of
blob IDs from the path-walk API could be much longer than the batch
size. At this moment, it is unclear if there is a benefit to split the
list when there are too many objects at the same path.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-backfill.txt
Documentation/technical/api-path-walk.txt
builtin/backfill.c
t/meson.build
t/t5620-backfill.sh [new file with mode: 0755]