Re: [PATCH 0/5] backfill: accept revision arguments
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 17, 2026, 21:45 UTC
- Message-ID
- <xmqq7brajfjd.fsf@gitster.g>
- In-Reply-To
- <pull.2070.git.1773707361.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 13 quoted lines
> The git backfill command assists in downloading missing blobs for blobless > partial clones. However, its current version lacks some valuable > functionality. It currently: > > 1. Only walks commits reachable from HEAD. > 2. It walks all reachable commits to the full history. > 3. It can focus on the current sparse-checkout definition, but otherwise it > doesn't focus on a given pathspec. > > All of these are being updated by this patch series, which allows rev-list > options to impact the path-walk. These include: > > 1. Specifying a given refspec, including --all.
Makes sense. You can only be on a single branch at a time, but may want to work on multiple topics in reasonably quick succession in a single repository. Being able to prepare enough material to go back to when working on whichever topic in a single backfill invocation would be a welcome addition.
> 2. Modifying the commit walk, including --first-parent, commit ranges, or > recency using --since. > 3. Modifying the set of paths to download using pathspecs.
Both are good mechanisms to express which subset of history you will be working on.
Show 6 quoted lines
> One particularly valuable situation here is that now a user can run git > backfill -- <path> to download all versions of a specific file or a specific > directory, accelerating history queries within that path without downloading > more than necessary. This can accelerate git blame or git log -L for these > paths, where normally those commands download missing blobs one-by-one > during its diff algorithms.
Yup. Even if your project is a huge monorepo that contains all, you do not necessarily have to look at everything the organization has all the time. "git blame -C -C -C" would of course not work in such an environment (would it end up on-demand lazy fetch these blobs, or are there ways to say "I know the object store of my repository is only sparsely populated, and I do not want you to on-demand download the missing blobs---do your best to work with only what is already available?), but that's a tradeoff a monorepo makes.