Files
git/builtin
Siddharth Shrimali 1e746b00aa builtin/repack: add --drop-filtered and --dry-run options
Add two new command-line options to 'git-repack':

  --drop-filtered: intended to eventually delete objects that match
                   the filter specification. Requires --filter and -a,
                   and is incompatible with --filter-to.
  --dry-run: show which objects would be dropped without making any
             changes. Only meaningful with --drop-filtered.

Keep --dry-run as a separate option rather than folding it into
--drop-filtered (e.g. --drop-filtered=dry-run), to stay consistent with
the --dry-run option other Git commands already provide and to leave
room for it to describe other repack behavior later. A
--drop-filtered=<mode> form can still be added later if more
drop-specific modes are needed.

--drop-filtered also requires a promisor remote to be configured, since
dropping objects without a remote to fetch them back from would be
permanent data loss.

--drop-filtered is incompatible with bitmap writing: filtering breaks
the "all objects in one pack" closure that bitmaps require. Detect an
explicit -b/--write-bitmap-index on the command line with a dedicated
option callback that sets a "write_bitmaps_given" flag, so it can be
distinguished from a repack.writeBitmaps configuration value even when
config already enables bitmaps. An explicit -b is reported as a conflict,
while a config-provided default is silently disabled for the duration
of the command.

These options currently only perform validation. The actual enumeration
and deletion will be added in follow-up commits.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-13 13:34:49 -07:00
..
2026-04-10 07:58:53 -07:00
…
…
2025-09-29 11:40:35 -07:00
…
2026-07-07 10:49:41 -07:00
2026-07-13 08:27:27 -07:00
2026-07-19 10:42:19 -07:00
…
2026-07-30 10:32:03 -07:00
2026-03-31 20:43:14 -07:00
2026-07-07 10:49:40 -07:00
…
2026-07-07 10:49:40 -07:00
2026-07-07 17:48:57 -07:00
2026-03-31 20:43:14 -07:00
2026-05-06 09:48:28 +09:00
…