Re: [GSoC PATCH v4 7/7] Documentation/git-repack: document --drop-filtered and --dry-run
Christian Couder <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <CAP8UFD3Zvm1rCy6iaviK4jjAXuL4Rkkr7yCTEv-pCdaJYgL_Nw@mail.gmail.com> |
On Mon, Aug 10, 2026 at 7:41 PM Siddharth Shrimali <[email protected]> wrote: > Documentation/git-repack.adoc | 37 +++++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/Documentation/git-repack.adoc b/Documentation/git-repack.adoc > index 72c42015e2..63943b078c 100644 > --- a/Documentation/git-repack.adoc > +++ b/Documentation/git-repack.adoc > @@ -12,6 +12,7 @@ SYNOPSIS > 'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [-m] > [--window=<n>] [--depth=<n>] [--threads=<n>] [--keep-pack=<pack-name>] > [--write-midx[=<mode>]] [--name-hash-version=<n>] [--path-walk] > + [--filter=<filter-spec>] [--drop-filtered [--dry-run]] > > DESCRIPTION > ----------- > @@ -182,6 +183,42 @@ depth is 4095. > `objects` and `objects/info/alternates` sections of > linkgit:gitrepository-layout[5]. > > +--drop-filtered:: > + Delete the local objects that match the `--filter` specification > + instead of keeping them in a separate packfile, reclaiming the > + disk space they occupy. This is intended for partial clones, > + where the filtered objects are promisor objects that remain > + recoverable from the promisor remote and are lazily re-fetched > + on demand when they are next needed. > ++ > +Only large blobs are supported for now, so `--filter=blob:limit=<n>` > +is currently the only accepted filter. Because dropped objects must be > +recoverable, this option requires a promisor remote to be configured > +and refuses to run otherwise. > ++ > +This option requires `-a`, and implies `-d`: the objects are dropped by > +rebuilding the promisor pack without them and then removing the now > +redundant old packs, so the redundant packs must be deleted for the > +space to actually be reclaimed. It is incompatible with `--filter-to` > +and with bitmap writing (`-b`/`--write-bitmap-index`), since filtering > +breaks the single-pack closure that bitmaps require. A bitmap setting > +coming from configuration is silently disabled for the duration of the > +command. > ++ > +As a convenience since dropped objects remain recoverable by lazy fetch, > +`--drop-filtered` refuses to run while another operation > +(merge, rebase, am, cherry-pick, revert, or bisect) is in progress, to > +avoid a surprising network fetch mid-operation, and refuses to drop any > +blob that the current index references, since such a blob would only be > +lazily re-fetched by the next command that inspects the working tree. > +These checks are skipped in bare repositories, which have neither a > +working tree nor an index. I think this patch could be squashed into patch 5/7 ("builtin/repack: actually drop filtered promisor blobs") except the above paragraph which could be added by patch 6/7 ("builtin/repack: add guards for --drop-filtered"). Thanks.