Skip to content

Commit 85bd445

Browse files
committed
Introduce 'git backfill' to get missing blobs in a partial clone (#5172)
This change introduces the `git backfill` command which uses the path walk API to download missing blobs in a blobless partial clone. By downloading blobs that correspond to the same file path at the same time, we hope to maximize the potential benefits of delta compression against multiple versions. These downloads occur in a configurable batch size, presenting a mechanism to perform "resumable" clones: `git clone --filter=blob:none` gets the commits and trees, then `git backfill` will download all missing blobs. If `git backfill` is interrupted partway through, it can be restarted and will redownload only the missing objects. When combining blobless partial clones with sparse-checkout, `git backfill` will assume its `--sparse` option and download only the blobs within the sparse-checkout. Users may want to do this as the repo size will still be smaller than the full repo size, but commands like `git blame` or `git log -L` will not suffer from many one-by-one blob downloads. Future directions should consider adding a pathspec or file prefix to further focus which paths are being downloaded in a batch.
2 parents 9e5a8bf + d4e9d87 commit 85bd445

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Documentation/git-backfill.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-backfill - Download missing objects in a partial clone
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git backfill' [--batch-size=<n>] [--[no-]sparse]
12+
(EXPERIMENTAL) 'git backfill' [--batch-size=<n>] [--[no-]sparse]
1313

1414
DESCRIPTION
1515
-----------

builtin/backfill.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "path-walk.h"
2727

2828
static const char * const builtin_backfill_usage[] = {
29-
N_("git backfill [--batch-size=<n>] [--[no-]sparse]"),
29+
N_("(EXPERIMENTAL) git backfill [--batch-size=<n>] [--[no-]sparse]"),
3030
NULL
3131
};
3232

0 commit comments

Comments
 (0)