Subject: Re: [PATCH 6/9] repack: add `--filter=<filter-spec>` option

From: Taylor Blau <[email-masked]>
Date: Wed, 21 Jun 2023 07:20:36 -0400

On Thu, Jun 15, 2023 at 05:43:27PM -0700, Junio C Hamano wrote:
> Christian Couder <[email-masked]> writes:
>
> > After cloning with --filter=<filter-spec>, for example to avoid
> > getting unneeded large files on a user machine, it's possible
> > that some of these large files still get fetched for some reasons
> > (like checking out old branches) over time.
> >
> > In this case the repo size could grow too much for no good reason and a
> > way to filter out some objects would be useful to remove the unneeded
> > large files.
>
> Makes sense.
>
> If we repack without these objects, when the repository has a
> promisor remote, we should be able to rely on that remote to supply
> them on demand, once we need them again, no?

I think in theory, yes, but this patch series (at least up to this
point) does not seem to implement that functionality by marking the
relevant remote(s) as promisors, if they weren't already.

> [...] It does smell somewhat similar to the cruft packs but not
> really (the choice over there is between exploding to loose and
> keeping in a pack, and never involves loss of objects).

Indeed. `pack-objects`'s `--stdin-packs` and `--cruft` work similarly,
and I believe that we could use `--stdin-packs` here instead of having
to store the list of objects which don't meet the filter's spec. IOW, I
think that this similarity is no coincidence...

Thanks,
Taylor