git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 18 in “rev-list: add --missing=print-only mode”
  1. 0/1 rev-list: add --missing=print-only modeSiddharth Asthana, Apr 19, 2026
  2. 1/1 rev-list: add --missing=print-only modeSiddharth Asthana, Apr 19, 2026
  3. Derrick StoleeApr 19, 2026
  4. Siddharth AsthanaApr 20, 2026
  5. Derrick StoleeApr 20, 2026
  6. Patrick SteinhardtApr 20, 2026
  7. Phillip WoodApr 20, 2026
  8. Patrick SteinhardtApr 20, 2026
  9. Siddharth AsthanaApr 20, 2026
  10. Kristoffer HaugsbakkApr 20, 2026
  11. Siddharth AsthanaApr 20, 2026
  12. 0/1 rev-list: add --missing-only option to filter outputSiddharth Asthana, Sep 1, 2026
  13. 1/1 rev-list: add --missing-only option to filter outputSiddharth Asthana, Sep 1, 2026
  14. Junio C HamanoSep 1, 2026
  15. Siddharth AsthanaSep 1, 2026
  16. Junio C HamanoSep 2, 2026
  17. 0/1 rev-list: add --missing-only option to filter outputSiddharth Asthana, Sep 3, 2026
  18. 1/1 rev-list: add --missing-only option to filter outputSiddharth Asthana, Sep 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.