All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Cc: git@vger.kernel.org, coygeek@gmail.com, ben.knoble@gmail.com,
	gitster@pobox.com
Subject: Re: [PATCH v2] repack: do not rebuild packs on --dry-run
Date: Tue, 13 Oct 2026 13:30:43 +0200	[thread overview]
Message-ID: <as4WY96-KXQT_PTc@pks.im> (raw)
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

      parent reply	other threads:[~2026-10-13 11:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  6:25 [PATCH] repack: do not rebuild packs on --dry-run Siddharth Shrimali
2026-10-08 12:56 ` D. Ben Knoble
2026-10-10 19:53   ` Siddharth Shrimali
2026-10-08 14:23 ` Junio C Hamano
2026-10-10 20:05   ` Siddharth Shrimali
2026-10-10 21:00 ` [PATCH v2] " Siddharth Shrimali
2026-10-10 21:06   ` Ben Knoble
2026-10-11  5:57     ` Junio C Hamano
2026-10-13 11:30   ` Patrick Steinhardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=as4WY96-KXQT_PTc@pks.im \
    --to=ps@pks.im \
    --cc=ben.knoble@gmail.com \
    --cc=coygeek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=r.siddharth.shrimali@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.