From: Patrick Steinhardt Date: Tue, 13 Oct 2026 11:30:43 GMT Subject: Re: [PATCH v2] repack: do not rebuild packs on --dry-run Message-ID: In-Reply-To: <20261010210050.76064-1-r.siddharth.shrimali@gmail.com> On Sun, Oct 11, 2026 at 02:30:50AM +0530, Siddharth Shrimali wrote: > builtin/repack.c | 7 +++++++ > t/t7706-repack-drop-filtered.sh | 19 +++++++++++++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/builtin/repack.c b/builtin/repack.c > index c4360382c1..7797972642 100644 > --- a/builtin/repack.c > +++ b/builtin/repack.c > @@ -387,14 +387,21 @@ int cmd_repack(int argc, > if (dry_run) { > struct oidset_iter iter; > const struct object_id *oid; > > oidset_iter_init(&drop_oids, &iter); > while ((oid = oidset_iter_next(&iter))) > printf("%s\n", oid_to_hex(oid)); > + > + /* > + * Only list the candidates to be dropped; skip > + * the actual repack > + */ > + ret = 0; > + goto cleanup; > } > } Okay, makes sense. I wonder though, we later have a check like this: if (pack_everything & ALL_INTO_ONE) { repack_promisor_objects(repo, &po_args, &names, packtmp, (drop_filtered && !dry_run) ? &drop_oids : NULL); Is the `!dry_run` check redundant now because of the above early exit? Patrick