From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 AB544481FCE for ; Thu, 8 Oct 2026 09:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791453152; cv=none; b=ieJpHFD4CdOU0zGIaFf/BU7A7BE/YqwqC63oVeB/Po4tP7vtLg8d+VEQlWgdFyGlJe7XEP2DwRP9kMdDPs3U83uQsDjCFFpaBKgKEQ9SQK+P7eR/upoHwi+JFMk3W3pIJu/S2Su4EpQ3feU7HYZXV28eI/tfj7QIRgxgyXCUhx0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791453152; c=relaxed/simple; bh=RE7BozTJeFZyzVTFFsfXdjNxK3d5GQXXwQSfDewYZDY=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=rTwLnNU12xLqieTYS1g/OkkQdZWaSNL84SJlkN5g1MEUtyxIMwjwk7E4Z8PwklZo1l/QGi19VtAQgR6RCCu1O7ZD8tnigoXlZBqjP4n6YYmOuoMGKQYnOcNIj3eDlDry5jZodqhtDCupkNIvQEY8LQGPrEthBcR+ynOiAWXKD6A= ARC-Authentication-Results:i=1; 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=BnfhsV3S; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BnfhsV3S" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-873a4edb243so3537658b3a.0 for ; Thu, 08 Oct 2026 02:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791453150; x=1792057950; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:content-type:fcc :subject:date:from:references:in-reply-to:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=C4gC0GIpX64VxYXTHzgjuUD+1RaVmsibmyIZqa2vxP0=; b=BnfhsV3SMmX2I2lfjGSM9Z6IItyB9/en2K/KXgeQz5zW4q0Os6bHo1+ncxqSwvF0bp FYI3BLbc2pacXFBJdaltkH6jKGJ+RSN2fyacYC7Q7md6nyQygfzw+L7K7AzWFt9OtpNN VG5PqBDUCt1VduTefFbvXi7f5ZjHj1i9cKHZNQfva82oUHZ8h2JPYhQc4UvlGuGoPw43 as3Z+jbT/5mFQXtY3y8OvsoIsIOCJkZl3pO9QyZfyHZifjE2fY2FJ8VnaI6c1O9B7pCu xD8L8FhUW2yxk0udH8yy14p6gdIElqLO5wPBk4pXrI4MHMUxQVOj+THDj+IHADKjzVZK Xi0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791453150; x=1792057950; h=cc:to:mime-version:content-transfer-encoding:content-type:fcc :subject:date:from:references:in-reply-to:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=C4gC0GIpX64VxYXTHzgjuUD+1RaVmsibmyIZqa2vxP0=; b=UcaswRXyDxjmG1Pcyu8GXj3+Q3KxLWvl+YnDpYKzgH29Jp1Omjlc85hnQNjAYa/aCR 8Ci+VjNsmYfU/ZtlpHyShTGM0ZNpvwhQLK3lD8H9WcgDtQ/oddFAK7n5lslts+p4v6FQ jRFJxlLGgLCEUJl+RDxHRKr6wIcXO6URqZ2zuOoF2an+EMaqoIA16Yi8uU0nUl1wl2Nz NQfmHz0LIAjjGhZyeE2lnC74kWxkylOtdg5+/xbpSXDNChpYmWRhJiNBDc8TbQzhVI9b /VDbdW0GaPhsA5QDcBYM2gnMM99MDqSJmkVujyzz1wOC2IZz01JOoXJZtAP++GichYcV hlsA== X-Gm-Message-State: AFuF++mGr1r3fvocpwq5hgLarVc8uPNKmEk0OJrrlG1JKrwat8kkY9M1 1/7aVBvrcoEB99wNsVexCRIFndfBORR9oQXeUuEIHdWhvwcUtehViF1yX17b3In5 X-Gm-Gg: AYBFou0tj1Vb1x8FBhZ3mhSkvVyMtZxifXmrnYDOaeGcDsSfcyAZvTQ1aRiajQf8PI0 h/xZ5OCehCVPipfqbcI9aAkSydzG9WBCgy96uKLJLXoeklvHPfRtn2F1eAMWkixNz0zK1dEdj06 /3a/gABdoI+u1IyEbjCdywwROOwg2g78msexR1yIgtMXtYNGf01J4gAQzmb4GYavo1ZlTGcgUZj xBLCCXDIcFDBCM3LQ/i7O4d6WmyyDaT604gdXZ/R5+/joq68QPCeP/8GAw7Semwnm7kQ/tMMDh6 YBYVe08Fcd71bCE3h6eKuAemo8m3b6QM528qDorsX5WVSI+8LF1QhqzoVHley12PHsg3YWtRZpI Hkkbi+MjlxHAH7WBWm3sdbWMdy0qGy55OQlQc3t2lyl/6aZQ/FQFd+Q4LA/7xhnx2lkZ0b5VdPj rCdfZvNt7bMWPh+82hlcmXR7g9tz8GOsVc773Ga7G9i5Yj3voh0O1uPfuPxBSL95g6pLDz7utXl w== X-Received: by 2002:a05:6a00:348c:b0:882:359f:ef17 with SMTP id d2e1a72fcca58-891b138dae4mr4299383b3a.12.1791453149901; Thu, 08 Oct 2026 02:52:29 -0700 (PDT) Received: from [127.0.0.1] ([4.154.246.147]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-892bc17706csm1302465b3a.60.2026.10.08.02.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2026 02:52:29 -0700 (PDT) Message-Id: <148175cfa00fd835a296dd1ed04703c2a80b7e3d.1791453141.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Qin ShiCheng via GitGitGadget" Date: Thu, 08 Oct 2026 09:52:20 +0000 Subject: [PATCH v3 4/5] pack-objects: add --keep-pack-from-file Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Patrick Steinhardt , Taylor Blau , Junio C Hamano , Justin Tobler , qeesung , Qin ShiCheng From: Qin ShiCheng "--keep-pack" names one pack per occurrence, and there is only so much room on the command line: ARG_MAX is shared with the environment, and on Windows the whole line is capped at 32,767 characters, which a few hundred pack names fill. Past that the spawn fails before pack-objects has started. fetch-pack grew "--stdin" in 078b895fef (fetch-pack: new --stdin option to read refs from stdin, 2012-04-02) for the same reason. stdin is taken here: every mode repack drives pack-objects in already uses it, for the revision list under "-a", object names for the promisor pack, and pack lists for "--stdin-packs" and "--cruft". So read the names from a file instead, one per line, skipping empty lines. They go into the same list as the "--keep-pack" names and are treated exactly alike: matched against local packs, ignored when they match nothing, and kept open under "--stdin-packs=follow". A relative path is resolved against the directory the user ran from, as "--refs-snapshot" of "git multi-pack-index write" is. The list now holds strings from two sources, so let it own its copies. repack is about to use this to hand pack-objects its own snapshot of the packs that have a ".keep" file. Signed-off-by: Qin ShiCheng --- Documentation/git-pack-objects.adoc | 8 +++++ builtin/pack-objects.c | 28 ++++++++++++++++++ t/t5331-pack-objects-stdin.sh | 46 +++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) diff --git a/Documentation/git-pack-objects.adoc b/Documentation/git-pack-objects.adoc index 65cd00c152..938e27f69d 100644 --- a/Documentation/git-pack-objects.adoc +++ b/Documentation/git-pack-objects.adoc @@ -13,6 +13,7 @@ SYNOPSIS [--no-reuse-delta] [--delta-base-offset] [--non-empty] [--local] [--incremental] [--window=] [--depth=] [--revs [--unpacked | --all]] [--keep-pack=] + [--keep-pack-from-file=] [--cruft] [--cruft-expiration=