Subject: Re: [PATCH 2/9] pack-objects: add `--print-filtered` to print omitted objects

From: Junio C Hamano <[email-masked]>
Date: Thu, 15 Jun 2023 15:50:17 -0700

Christian Couder <[email-masked]> writes:

> When using the `--filter=<filter-spec>` option, `git pack-objects` will
> omit some objects from the resulting packfile(s) it produces. It could
> be useful to know about these omitted objects though.
>
> For example, we might want to write these objects into a separate
> packfile by piping them into another `git pack-object` process.
> Or we might want to check if these objects are available from a
> promisor remote.
>
> Anyway, this patch implements a simple way to let us know about these
> objects by simply printing their oid, one per line, on stdout when the
> new `--print-filtered` flag is passed.

Makes sense.  It is a bit sad that we have to accumulate everything
until the end at which time we have to dump the accumulated in bulk,
but that is a current limitation of list-objects-filter API and not
within the scope of this change.  We may in the longer term want to
see if we can make the collection of filtered-out objects streamable
by replacing the .omits object array with a callback function, or do
something along that line.