🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #69

Re: [BUG] repack --drop-filtered --dry-run writes packs and honors -d in Git 2.56.0

#69
From: Siddharth Shrimali
Date: Thu, 08 Oct 2026 02:25
46 lines
10681 bytes
Hi Coy,

On Thu, 8 Oct 2026 at 00:40, D. Ben Knoble <ben.knoble@gmail.com> wrote:
>
> Cc: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> who authored
> the --drop-filtered code.
Thanks Ben for the cc

> On Sun, Oct 4, 2026 at 7:47 PM Coy Geek <coygeek@gmail.com> wrote:
> >
> > On Git 2.56.0, `git repack -a --filter=blob:limit=1m --drop-filtered
> > --dry-run` prints the candidate blob but also writes a new promisor
> > pack and its sidecar files. Adding explicit `-d` also removes the old
> > redundant packs and their sidecar files.
Thanks for the report and the reproducer.

The issue is that the --dry-run block in cmd_repack() prints the
candidates but does not stop there. it falls through to
repack_promisor_objects(), which writes the new promisor pack, and
with an explicit -d it also reaches existing_packs_remove_redundant(),
which deletes the old packs. the earlier
"if (!dry_run) delete_redundant = 1" only stops -d from being implied,
not from being given explicitly.

The fix is two lines in builtin/repack.c: at the end of the
"if (dry_run)" block, right after the loop that prints the candidate
object IDs, add

    ret = 0;
    goto cleanup;

so a dry run returns as soon as the candidates are listed, before any
pack is rebuilt or deleted.

I will also add a test to t/t7706-repack-drop-filtered.sh that runs the
dry run both without and with -d, and checks that the pack directory
is unchanged, the candidate is still printed, and the blob is still
present

I will send the patch shortly

Thanks,
Siddharth
Technical Details
Message-ID: <CAGWgyh9QTN8T=ZyvbEGA16acNw4KGLBeg1R4mt=E_nAGGU8APA@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71421-linux-kernel-git=dewy.ru
References: <CACgTecOm+=vbf50tZNXhcYvRi1ZTsQwbjVoJAbQqs2CmXdJCxg@mail.gmail.com> <CALnO6CCmv7PmxW2HTfvD8i6-PCVqMWgasyU9PYhPLXGj1sz=Hg@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-71421-linux-kernel-git=dewy.ru
From: r.siddharth.shrimali@gmail.com (Siddharth Shrimali)
Newsgroups: linux.kernel.git
Subject: Re: [BUG] repack --drop-filtered --dry-run writes packs and honors -d
 in Git 2.56.0
Date: Thu, 8 Oct 2026 07:55:34 +0530
Organization: Usenet Network
Message-ID: <CAGWgyh9QTN8T=ZyvbEGA16acNw4KGLBeg1R4mt=E_nAGGU8APA@mail.gmail.com>
References: <CACgTecOm+=vbf50tZNXhcYvRi1ZTsQwbjVoJAbQqs2CmXdJCxg@mail.gmail.com>
 <CALnO6CCmv7PmxW2HTfvD8i6-PCVqMWgasyU9PYhPLXGj1sz=Hg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="784476"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jJZ5NKLekRniO0fkaZeTaXcRRXw= sha256:UL2pOVxkokF3kBGGnB6uluOTI1T3/enCNxNLsP8HcEQ=
	sha1:mIRLRi8m/GeCSC8cNlCMSc6FEJM= sha256:/eX7D0Cl96jPw8kFCFgvhb+cVi01auy5YMAvdcsmZ0E=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 7C00710F2B4; Thu,  8 Oct 2026 05:26:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id zQjeVg_kICvJ;
	Thu,  8 Oct 2026 05:26:32 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-71421-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 62A3410F253; Thu,  8 Oct 2026 05:26:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 97C0232F77; Thu,  8 Oct 2026 02:26:13 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E3F03A2559;
	Thu,  8 Oct 2026 02:26:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VIt4tzA0"
X-Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2988133CEA5
	for <git@vger.kernel.org>; Thu,  8 Oct 2026 02:26:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.210.173
X-ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791426372; cv=pass; b=O5DtPJUeqnedU/Kslq7AcZT/iEG90lcdUORJ3y+DFeUOhzjfnvOZ5nxpxZysLg0XtZ9/7B/VDSo+mRLxAP76WiDTjtrwd8Bl8M89pv7t3+kRZmuF8Bxkv1wfEC3+s6kGN2Lvp27W40ARoT7qU0qZfhoX3Bc51n7j1KL5THgrrHA=
X-ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791426372; c=relaxed/simple;
	bh=YnzUpfP0r5lo34HRarK12s+dVsou7CzSlSNACnTyZGw=;
	h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
	 To:Cc:Content-Type; b=hZk929n9QH4eJEpFGpU619/jnMhAmJHuXGD1pYLtM933yMJ4fRdGZwRAmxwPpNri+a6/bU8gqrFR9Ue2/E3+ONfyZ8CTR934p+qbuX2Q+ej9xdYDM/5NZaLh+wyL+ioiIwyPQb2f2SHXt6n8kInnMtK3ZndOgEGiIFEj99POrP0=
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VIt4tzA0; arc=pass smtp.client-ip=209.85.210.173
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-88bd2b44f3aso1369170b3a.0
        for <git@vger.kernel.org>; Wed, 07 Oct 2026 19:26:10 -0700 (PDT)
X-ARC-Seal: i=1; a=rsa-sha256; t=1791426370; cv=none;
        d=google.com; s=arc-20260327;
        b=I6MJQXsIag8z2qSSrz2ODQLO1bi5Npi2qRFPUnj2llKfCLcB0O7Q81JqktSNWGc0dj
         NVCzhDXoDXQrrtrimsp0Bt9Svf0Vsz8qkQ/6on9nWrfVsnknvlJjf+IiiSZf8VYWB1uV
         qyD3rS8Aid2p8gcfVg8UY+wPLT/P3nWEfW1zZ9DWk1Tv7sWwETlpv4CUcLnwyOVr+y/r
         dltFb8wqNSRbzaT36gmVwg5i0TLPlJAo4Qd82ZQaYPJLZVVWUln9W8ZgeTrir1solPqY
         K1yRAFMOERIhBJCBTdYI/gzefae/HPjJhnUaRY8GzbGlgwa8Fw6AdE3/RtQgjW3IpX9b
         JaoQ==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=Ex8hndpZeC8FePYn10CmkmXrK5a5gx4IGc6GJIaHCNI=;
        fh=xDJmRxaAEZkfDG+Qj6KmyzGnR5IjZJpjz0OZfaFTUw4=;
        b=Wp5MTyeXK5OpX/G5YUp54sCK//wJXCcgrF/4jECevMMCyEDoyvyH6BsxXDlZkOBILS
         rzSHRXXyA2jWllhvqYZwa4i8COF2tx44dNqc75HxDfiFyPeuP6qDXk5wGN3kSGRtEkGH
         WqyoAu3kwEO9nTtsuRhom7f+PTsatCBODYZZ6bwx7jD/liKqD6LrDPtbrDkciFHT4Ec/
         WvJptr6P52QOw5eFCnrpOdz0MK7RZSWkSjs452imWDqBoDT03BRguTDAPM+K/PrCLvKn
         9iiCzLTzhAvYncInDDPhki4pp/Y835V0SI7hIOhQBrXgL2rrrr4ZSNmX2kSb2dr1X62q
         UewA==;
        darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1791426370; x=1792031170; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=Ex8hndpZeC8FePYn10CmkmXrK5a5gx4IGc6GJIaHCNI=;
        b=VIt4tzA08kHx740y7aZp4lS0PxeDVpixy5WtTav9ntKJZQxKudmOwZ+SYZxmItMpdU
         iCCdpJCXx52chwr1PjhU37EP4oxHsqPxYJUwl3+CiQhj+TLuyZpmSU1zA5UHQvV/kxlS
         kfmMuSwVlQCW9kvZXnGKpOdqQjO5MBltDgKyEA3PR2tRAB6aExFk0iFGeqjDcTxlZ76F
         985cGt7wt0Pe7BOfz7l72J2cc7liBwya23125Sw76gF9EzPPVr6WHjK0Z2YmRpokOJkx
         BJkGFot6+cWoedk3EEAvJ1dMv/KMNxB/UDHg6nQe9ab0t7cIv3hLhmpmW3UDkJTDEMM4
         piXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1791426370; x=1792031170;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Ex8hndpZeC8FePYn10CmkmXrK5a5gx4IGc6GJIaHCNI=;
        b=qMz32Eev+0uSMPmB1SaB/CYqT8bp5awh9rD2V62NP7AkEcAtqyk92TuRRc8Bxns1rj
         Oeo5FDJ6h09KjC8QUYiqIGGIQdLF+lm3x2y+D/2vWfKqh/fLI2v+rhn5RvsThmigQVZB
         oscPB3Xg1eLPU/P1/XUFdCzz0wLg5uW4DQssFpRnXRloRal6KxA1OgfW+ccrzCjwAgVm
         +ps2TFrkcNp6f2VpQn/DhACG8Cvx2NWBPhEMzRg5zlxf+WryCvYC1cZpE9MMzgVIwDTT
         wp0k0i7anfs2TVwvUkUdeRwpxkaYkRrXyfjrA/r1IJzZAkW14pscIaHkoWxdgryDPz8b
         HA7g==
X-Gm-Message-State: AFuF++lM2wq5zvVR8Giyl8NjsS5uXnjUA5VBKr6+KhHJru5948awDnPb
	daILNSQ+6ERwVG7PcuK2C4OCECuivJVtItII7O1NUdDFj2erLuPNODbehIjgaWSBFSYilYp32sh
	XoCEW0l8aq/L1hRJxT3QZ6/SpqISZjpA=
X-Gm-Gg: AYBFou3W/Eek6jdbP8pyEO4uO+IWHvVtKIUVk+t6LZ+uYaMuEdm0AI9JVV+bqYV3W0k
	UGCMbjaPWTR3jMnom00yapkf8236UBeYZNwJAKWidVGqN6YF8IduGE761zUl3hkJUvuCRrT3+6I
	ZxxwtDsdJXz/rSxrGeX3VTzrHMvtr6tV4c/f7KMZ8G4iOsiVKLKlXpBBgbydXSa5twLTBGm4lFY
	sCmdueItJO9T8ki+uZSbCQu1lqzQrW+G0P9oK/8jHCbX4Z8aUWHF/gJ+RcJIV49NnttGLPIc22s
	ZALjBtTV38VHWIChahcPFdr1hxQunLT4FvvaqbgjArHGNRcmYS3n3ZDaLeb/g16AV4IkOWeXseA
	SKWzISixoR46zSczScp7QAXGMMhN0VWK7PYbl0cYBvtb0ZktMaz29diTMjawa3AQBabq7nWt/ug
	==
X-Received: by 2002:a05:6a00:a803:b0:878:6ee:671c with SMTP id
 d2e1a72fcca58-891b53cd034mr3156240b3a.30.1791426370281; Wed, 07 Oct 2026
 19:26:10 -0700 (PDT)
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-In-Reply-To: <CALnO6CCmv7PmxW2HTfvD8i6-PCVqMWgasyU9PYhPLXGj1sz=Hg@mail.gmail.com>
X-Gm-Features: AclHuK83uxrq9cF-hVQFlGQbyNsL7keFqDFuHiDlt6-o43ksgj0OLhsuuqx_q-s
X-Cc: git@vger.kernel.org, "D. Ben Knoble" <ben.knoble@gmail.com>