Re: [PATCH v2 0/1] rev-list: add --missing-only option to filter output
- From
Siddharth Asthana <siddharthasthana31@gmail.com>
- Date
- Sep 1, 2026, 20:27 UTC
- Message-ID
- <29b5003e-48b3-490b-a4ec-c57088acc441@gmail.com>
- In-Reply-To
- <xmqq1pbcsq1h.fsf@gitster.g>
On 02/09/26 01:27, Junio C Hamano wrote:
Show 10 quoted lines
> Siddharth Asthana <siddharthasthana31@gmail.com> writes: > >> At GitLab, Gitaly uses rev-list --missing=print on partial clones to >> find missing objects. The output mixes present and missing objects and >> prefixes missing ones with '?', so we post-process it. --missing-only >> avoids that. > > Not an objection to the feature (as it can already be done with > post-processing), but stepping back a bit, how is this list of > missing objects used?
Thanks for asking
Show 14 quoted lines
> > You know what objects you currently have. They refer to other > objects, some of which you may lack. You can get a list of them, > and then what? After fetching them from 'origin', you will have > a new set of missing objects (e.g., after fetching a missing > commit, its parents become known and missing; after fetching a > missing tree, the blobs and trees contained in it become known > and missing). > > Fetching missing objects a batch at a time sounds like too much > back-and-forth to peel the onion, if the process using > '--missing-only' is trying to find out what it wants to fetch, > and would be a rather inefficient way to backfill a shallow > clone. So I wonder how this fits into the larger picture.
Agreed, we are not using it that way, and I would not want people to use it as a multi-round fetch loop either.
In Gitaly the main caller is transaction packing. When we commit a transaction we walk only the quarantine (plus the new ref tips) with something like:
git rev-list --objects --missing=print --stdin
- Objects that exist in the quarantine get packed and logged with the transaction.
- Objects that show up as missing (the '?' lines) are recorded as the transaction's dependencies. At apply time we check those OIDs already exit in the main repo and abort if they do not. We do not fetch them; they are expected to already be outside the quarantine.
So the missing list is a one-shot dependency set from a single walk, not iterative discovery / onion peeling. Today we parse the mixed output and strip the leading '?'. --missing-only is only so that path (and the old "count missing" demo) can get bare OIDs without post-processing.
Happy to clarify this in the commit message / docs in a v3 if useful.
Thanks, Siddharth
> > Thanks.