From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk2-f13.google.com (mail-qk2-f13.google.com [74.125.230.205]) (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 8607C3E2ABA for ; Fri, 18 Sep 2026 03:03:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.230.205 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789700628; cv=none; b=oNaePFQa9jE7ut/Wb5oXsB1x1Xf3a2giKW7dolActxC1R+j72cjlbdQvtXpDay7HiQEIsAm2+TZ9fgBUSDEzkc2tzf8GRmEzuA2h5DTdydtslso7V03b0oKsXbIlymL12YxgcV915btrXftHIcAGg/EejPRjmSdnQEUdj+gwVww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789700628; 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=kE0d/l0BhNj9aGovDEo10i17xIfos2F2auTQGDmmGBEAnYUh5acvfix3Ut+McYp79kTmnsAiRSjqDktp2u0Z5RACKdD4agtRMxJlfBuo9pTFcvoyGg+tJZRcU2S3sRmZVQY7bSc93c/UKiBKTqQe5+LYacHlbT0xMbPQlv1DU3s= 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=ow8IwqxV; arc=none smtp.client-ip=74.125.230.205 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="ow8IwqxV" Received: by mail-qk2-f13.google.com with SMTP id af79cd13be357-939eb3249c1so25947285a.2 for ; Thu, 17 Sep 2026 20:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789700621; x=1790305421; 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=ow8IwqxVjsWDuQ1yJu6TtFwoj2VslKCEl/xTr4hR3GUCpXfeWohqKczvGLCVK+cj7B xT0ZQ8C8wj8rwwwboU1vebRnli3kV/ROgKb/CZVnqKvwl2OpGqn6MAF3T6MtzIzydcix 7vRrWhTxX+OauSctHrdvmU7ymsKnl39EsF74IL5K8A78cMcV9Fsa2aRMzYmJdyNNuiKJ gJcAsPVx/M2fNeTVZ/VOu15zhFAXixxjdBA6WYAx1MnbcrsXc6G6wG6f9C1yKtwoh19W MGripTBVDaTN9AJYgNHL19MIQFS/XjPWJnGTd43bp2pt5gmMcJG8iOGHznE06aBJl1sQ 5LnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789700621; x=1790305421; 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=2zuBJrjK5PNkWY6V/zrNhVYj/LtqbUTgS/QceDPSciFXiG54R9urIJD5aoTsgBrwvm 20k4apFZq/oPjp/ES4FsQIdMgGCt3okeEg2bQ9/pjjUTKutII3L7OTDuawO7ZfxqeLVh 736TeiMDKBm4ndBamysG5ZxdXjsBRe6hc/XAETT4i4jHYsJFguBjp6k+3XAQ09wiDj+J dKNXzAO1zKDEA6pbxXvrpTBCn8LsGA8RMqTnw/EO+r5SOHFErBf6UwvaT2bJ5Uaqp5w2 xx6/HHMRiyvSEDYdTVaq+U4HzAGISeli76Tjrcx+rPZeJHX02GO4rH8Uq8DSVdFW302v LEAA== X-Gm-Message-State: AFuF++mSVYyP3JA2MBJzRyeMifLq3/MPv8WCsVVCOf/v4VmtBVAXL22w cxOGreeDtmKakXrgCwTdYR9JO7y7VFMXPo96nLBYgKaY7bX+ANVJk92pkvo7OQ== X-Gm-Gg: AYBFou0tXIZ7HgkDtSNJLcZmejEp+EAmkSBxG0nSOE5+QIFu2b3N84/vpXNh+MY/C5m ZWFXlD6f4OMF5N0b+RK9Hl8yZqRtZCXHWjX5fr5Is36McNYjD0fmRNb6+x/VX98SECyVHUoFZ6G xH3N7Q76Rop7TN1BYnJg2NoC/619wqvNDHq52j4RC4C4aGa8VkxQB8tuTD397jzLfVcd5DKIzjT X+DoXxQufYuL5i0zquKmVK+cLXasCTmkVws6ZMLeQ7IZIIRQ8Uc9Yz+1pBokwq3abMAarqdMliT vPZeln7dYIHEBBo4l4dguZWfYEZm1WCrneewB4/JocTY1Nvt2DMIqR4+9QXanh4OxGudaJmcF00 dXvMKnDd0nKLRqfHmpjtfkxs8ZnM4FAp5h+HIwbwQGKrbtFSmjb0pj7909VqDiTuvoQd/12cC7Z pqxay36v3GzYT1IzyXk5hLMVeUpj/FpO5FW3+mNXEFUyLs6c37hGlYS6Ff2wPh4vdSIbu1wlyqx A== X-Received: by 2002:a05:620a:708d:b0:939:d762:e2d8 with SMTP id af79cd13be357-93bdc7308e0mr150910885a.31.1789700621493; Thu, 17 Sep 2026 20:03:41 -0700 (PDT) Received: from [127.0.0.1] ([20.97.198.245]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93be0e90a13sm27538485a.20.2026.09.17.20.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2026 20:03:41 -0700 (PDT) Message-Id: <20a051cfb6fb23b6cdb7adf6cf53a2b8eb2f4391.1789700616.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Qin ShiCheng via GitGitGadget" Date: Fri, 18 Sep 2026 03:03:34 +0000 Subject: [PATCH v2 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=