From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj2-f13.google.com (mail-pj2-f13.google.com [74.125.227.141]) (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 5DF1E446847 for ; Mon, 14 Sep 2026 11:31:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.227.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789385496; cv=none; b=Q36eRGIETV0VRPGfStQHaSmSkMqyPdE3uxIYvaTId+9UCQsC81p4bNG3NVCo+J2a9GSqUjAeNZg9SpIeLhSVwU24c/LaMyTGR8bBNXEFAA7jDVNPLipIQpJbM+VTKv6IcYj154ZkWKsbFcnN0B6PTUP8g+YSu5MnhN6Ca9anaGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789385496; c=relaxed/simple; bh=5Z4V3yPnDOxEad/m4r1X0w4S+aiRWuyaght+dqC7bHA=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=dMupFfYKwi+4Rt50m1lgS24nyHcwj08OGCAtcBehdGWzm9W3WoqMBK3/Y90rj5xMHLx8uw4jbI+JJbtUobEDKubqGXLOtfb0C1gtjcr9I6N8xxnznxq+5Mr2Y0YvAnAlqNpQEf4pGMi0bejvgqh8GdFsgKct6+8yWAZjmbMEK2w= 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=QIXQa8gF; arc=none smtp.client-ip=74.125.227.141 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="QIXQa8gF" Received: by mail-pj2-f13.google.com with SMTP id d9443c01a7336-2d747eb79f7so11716795ad.1 for ; Mon, 14 Sep 2026 04:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789385495; x=1789990295; 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=dKH9PEF0YOwsM1PNlmsMK2CSjvhcpygsK9JaAZhe/ds=; b=QIXQa8gF+ennJWEzPxpk9dTmQzYAji5Kye5suRPM0rlW0UYAs/oeysyaQhd4ZywLfS yC4MMDwAl78MuwOK5BxMcmIMMwkm+ZAZ9HZSVwAXAOmFMuvWBmpXzPZ15pkSB9w5SPU2 q9Wp4HB3Vx2C1DOR6hjmQZKXYx7VPjRP1L3zuzzZKvHLn0/updRMl4HqqJYD/s0/7Q1i 6MtA5KWHSVXUIKhWV1UgLhi3Vz1m9kqYD39TOtIO2I7EifF5TWX7Js1UqGv1UZX60zDl iSQcPOwu+KJvoig8esEmE6Jf6ApxOb8c5kJibps4awK1yQ3AIol4Tmpqd7GoOfJCEM0r kUxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789385495; x=1789990295; 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=dKH9PEF0YOwsM1PNlmsMK2CSjvhcpygsK9JaAZhe/ds=; b=aUMyc4inxHeh979Rql8WOoiD960DHJZB+RR4m4dqPgdsRNkUFjVPlNLcSMyepeG6gH MbloG/wCFQfQqLs53I6VmabbBFoF0G7m0evm8tfbOgfA2K6uU8XenFK1Lz9E5FfDvinA 5wAtBsy66QpoDvrZNnes0purEMsThIKSxSnv2wsPd0mskLRKL9tsSkprEoXspezK+0fY 0euL7Y+tE7T2BD/rAh0MBRU5uLR3G+awbWWy9wemf6xxeDkxoYJUgO26jfP82+e5EzyU 7V16ciCq8tjzBYCTiXDSQUoMkclOHQDGMGY0RQmHrkQGF7llAg1OJOlpdeBBVZrhWv4z 7jpw== X-Gm-Message-State: AFuF++lls4l8pImYkvb33+zIgNjerGjTAWWgPD+gj7M8ICbJZysDz8Ol JQK8nwawdDEOGWVszkyrRpZ8m1OizRMWlM/uY7zGJ7x707j2t2DXi1bYiZIm5Q== X-Gm-Gg: AYBFou2OcvK49i2bj7Xs4YhYlU9F7ygq4VARxQwzeXmuaWqy8Px/Uzcv9sMTfANdC5q TPMw1mWr62r/toiuZxY3CS6cbnNI/RBhVr6zRDf19glwceZcCqFsomVA88SSqmsBXTuHcfzfZPW y7hxzUdz9EbI/zu6AJjjaE4V9DsT6auAW4LM5LXacXGnoJuuINDLnZF+o0qOU5UoEh3s9f/Xg8P DeoYl2wKw8zyix6ozgSzjAFWLBSuZSGk5/wB7lvbxBQdG2N9mrBSW0qp6bl8Z1iBC/yxi7IXF8a kyCg5nfGUuAsG4xLMm0Ts/aY93UMdVgDv9pPpLmVTjbaGa0cX4X0RZkkTaj75HdxUVFP2RknSOC TCnt4W9Uagh2KqpE3+GdhVY79SPvP9DspaMGxFmfQN/7p6dgza47qyLrpsKBtbEIvWk0wrv/of5 0HiGdVuMrxqM+i1PKhnsTmbh5Wbh6Caa0KFuQZ2ennADtg3bwB9YH9PzpUaCVEH3ydimaz0v9+H Vum X-Received: by 2002:a17:902:fc4b:b0:2db:257c:9fd5 with SMTP id d9443c01a7336-2dd6c70df7dmr54090605ad.16.1789385494524; Mon, 14 Sep 2026 04:31:34 -0700 (PDT) Received: from [127.0.0.1] ([172.184.219.146]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd2ceb715bsm46840525ad.39.2026.09.14.04.31.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 04:31:33 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Qin ShiCheng via GitGitGadget" Date: Mon, 14 Sep 2026 11:31:22 +0000 Subject: [PATCH 5/6] 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=