Subject: Re: [PATCH v1 1/1] rev-list: add --missing=print-only mode

From: "Kristoffer Haugsbakk" <[email-masked]>
Date: Mon, 20 Apr 2026 13:00:53 +0200

On Mon, Apr 20, 2026, at 10:57, Phillip Wood wrote:
> On 20/04/2026 08:43, Patrick Steinhardt wrote:
>> On Sun, Apr 19, 2026 at 02:18:40PM +0530, Siddharth Asthana wrote:
>>
>>>   static struct oidmap missing_objects;
>>>   enum missing_action {
>>> -	MA_ERROR = 0,    /* fail if any missing objects are encountered */
>>> -	MA_ALLOW_ANY,    /* silently allow ALL missing objects */
>>> -	MA_PRINT,        /* print ALL missing objects in special section */
>>> -	MA_PRINT_INFO,   /* same as MA_PRINT but also prints missing object info */
>>> +	MA_ERROR = 0, /* fail if any missing objects are encountered */
>>> +	MA_ALLOW_ANY, /* silently allow ALL missing objects */
>>> +	MA_PRINT, /* print ALL missing objects in special section */
>>> +	MA_PRINT_INFO, /* same as MA_PRINT but also prints missing object info */
>>> +	MA_PRINT_ONLY, /* print ONLY missing objects, without the "?" prefix */
>>
>> Makes me wonder whether we'll eventually also want to have
>> `MA_PRINT_INFO_ONLY`.
>
> Perhaps we'd be better to add a "--missing-only" option that limits the
> output to missing objects? That would avoid the problem of
> "--missing=print-only" not really explaining what it does as well.

The original `--missing` says what to do about missing objects. I find
`--missing=print-only` to be surprising:

• Do print missing
• But also do not print present objects

Why would a `--missing` option dictate what to do about objects that are
present (hide them)? That looks tacked-on.

`--missing-only` is better but has the same problem, IMO, of dictating
how present objects should be treated.

>From the cover letter:

CV> At GitLab, Gitaly uses `rev-list --missing=print` to find missing
CV> objects in partial clones. The current output mixes present and missing
CV> objects together, with missing ones prefixed by '?', so Gitaly has to
CV> post-process the output to extract just the missing OIDs. Having a
CV> dedicated mode that outputs only the missing OIDs directly would
CV> simplify this.

This makes me think that I want:

1. I do want missing objects
2. I do not want present objects

Which makes me think that something like `--present=no-print` makes
more sense.

Just speaking as a user and not looking at the code.

>[snip]