From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.153 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796122709; b=uJ2wGUq+beYNMSHv63IoyXTMJEfsBxMn7TRoeRmW/ACzxLVSNtbvKSJTT+oa1OZ5oYvE +fMSHW+xeGMPZR+7mkekjNuyatEcryE+eFZDFrb0XCKCCvqWlRo9lv79MOpbYBdfN/7Lm WG154P/cyslI8Nbc5JeCOs4R6jssLkpNv8rZa3uCpw9KXLlu12WOoT9tgzo45p6rM33Zt TBkvOZtvewmDL2QZ+CYXufL5DODFni+QiIRXLROoskumKFkqR44X05Q1IdHmDJSBmy4bv 794ItwL45hj1XPK6vkljE4mSo0GW1FZu74yWmIaqnKLTrIYjb004SZ0uTAAHgPKDTjQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796122709; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=iLIm/BlRqdXpvSU311AxpU7Bmh8v4QJZCd1niPGDFNQ=; b=iKmyPE+dtMNexYPzoTMOJKCUQ6BR/cXveIWhV8uKZJzlWDl8mQJa5Ioj6t1vEmZdqPE/ l1GeuWuzcRj/Fab/LtFsURTw+EBwbnAf9er7l4+xZWAunTz6p4QRcRkoPPS/E3YTaI2B2 viCtJRZHCwDyc1nf98NffDspw3n3iKZc1ex2hCmFA7HOkoOdvYG+JS4HREEF6qT9uH4hW paHTOWQ3s+RfMliKh3yG3ZKFrzF9VuI3kuaf237UxqS6xsSsGxJBfrlANHWWEyQIFSnvv /UYQnOOSlukuSACqb/NJZuYobBd6rPLn6bLVTjk9OqihZt/ANdYUVUUQx4rua1z9szw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass header.d=pks.im header.i=@pks.im header.a=rsa-sha256 header.s=fm3 header.b=xTSdJXbY; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=aTqhUFOR; arc=none smtp.remote-ip=202.12.124.153 Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7428606A320 for ; Tue, 1 Dec 2026 10:58:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B7428606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=pks.im header.i=@pks.im header.a=rsa-sha256 header.s=fm3 header.b=xTSdJXbY; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=aTqhUFOR Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id F076F7A056D for ; Tue, 1 Dec 2026 05:58:27 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 01 Dec 2026 05:58:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1796122707; x=1796209107; bh=iLIm/BlRqd XpvSU311AxpU7Bmh8v4QJZCd1niPGDFNQ=; b=xTSdJXbYo0KAJ3Ui/UBGgdphtp p2fwoSj8U9J2hwIvVfhsxtpfzFCqYW5blwWIINg9dxEoqgOi4VeN6yRF60pDLK2I +hG+XciaLBXDu7eFqEH+3SamqHjnUOqpQdJLL3Dc4riPI9itAfv33JfkOdz3beGg QCtIljJlCToN/Wd/UW4G8fMNHLyVL43nx2RXkWUe382uyYplqzqW/eClbrZ0eR/b C9U/3gavoG/VIUieTAcpR03ZkJER4/8uQQfH+lgOyvbrRxlzsOvzEYBQjxwR6zQ/ A01j0hw+tUKIaq39VJLEcWZkLo+qC7p5dn93NhLrK034iSYXDf3CQt2g7eRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1796122707; x=1796209107; bh=iLIm/BlRqdXpvSU311AxpU7Bmh8v4QJZCd1 niPGDFNQ=; b=aTqhUFORlQ2PmhzNI8rlfyU6pHcTJM/XwrOpPpXBVV7nQyGhKvq ++P7cV98dUxCLjPyOch7u1YtMGv/V/TgrlWdMF5qkco/WDopdsT3os2gN2/Kg7V1 3drGZxvVsCcHS8Ad8fbDAm8NwnBY94a3mCENFlexK6HEzQkA6f7rHoLNKUbnqejm /uZecmo+gx9u0QvFXyD3ceo1JqiaJfcaVnyG4Wk0uDq4OPAxF76Q2X8L0J6lf8UN zlIGgEJJsHpiSGEG1rvU/HyS5czuPAx8k9/z/LpyI+ZSe7rH1P9TiOzYZCpkl/Up q0l2XfdAl7pXmwYBplKQN+rOXg9nZpZSZGQ== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pks.im a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796122707; d=pks.im; mf=PHBzQHBrcy5pbT4=; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:Tt1YGLpaCdaQ07wtx3uk+rvzvaUdw2YwW6Vggg6ElRBUSAB erlgDEt80LpngbWpkegTVwrX0ElWl9u6mxnTVjIDIU9e1zSnroCBsho5vbfEYTwJ +1UzVIknWSgX/do5qkyvD3J4Jtt0uIwAxTBl0AT2WT3Rdra6YmlYeNV/xJ3U6Fip WO7cchW5S8AeQTnp93sY3vCFsDdCiV10muvYhIK5Q2dNL+C7unYJmbDVscY8OF9p 5rD5pS9g05leKXnLGjsvSt4zpYcAwngJW+FQHa1aat9KfIBCJ/9bBUTLQJ3B5hHC J5xFoAWiuJBB6I4+B3c324+NiaUEPvuCogIY8ew==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-type,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:pDuFyr0cCC6yD6yvgpDoHK5+/xz/4L4jCVZDTWw/i/A=:OxkXYVg6+MICahCIhTv9cYnsRmw68LJn2USXMFKiCyQ=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGl4/tLT+kFgdzpZt43HrG5610tynZGllbT0pYz8V9ADXsOX7zZ3ouFJkXX12zmS1 nFlLuyX9u62CyO+QzPvMptzQ1AuJgnoAkWtOiX88vgClHeP7C1n7WZYYfTvLMJZCdKLgU2 nGAAUMkOBSmzS+jyoMcs3/je2X13HBBYm11Mq3n8QIa2COeQw/yq7aeC3RXZjJjvo06IqE bxfXRGLUkDdC0R15EhM9CGwEhdAGr/+DCS+T3aIe+/hGKjaXEQRgv0qWRSBqEcdcK1sWAQ 6zkgiJBpRyAiLtApZ4BnuNCB1Wc65Y/7oobdY9qP82O5AohGVowtODgEIHvmgfeeKqwRma 1MlYD0imycmnAwAbMzGb7NKTS0lC/1nq4V5tVbrHmFMfSe6sN3ZYruBRSeiPNjI+RgS1Q5 NXlVnXbiGtR3l+hdWUNyGq5IO81XHQnVM+cr53mZN5R76ogdr8PDkYxUDpOIngZ+g4oWdo w0Ip1lT90E/H0RNkl9QXV+AliyG2jfXdoOBWAhKWLBmin77kF9dcpXKGUSecAhTy8ERtnh yFL8E3gxqpL70ee5Bv8psRu8xLmU7He8pKqsYut35ueuiZe3F1d5Zv5PF9ebugv+3A7Sf+ JICgMMHE67jFyP4nWneH1SG3FVHNnXRhAUj4JgoNbnzbNBv/zYiKNOuc6E7A X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Dec 2026 05:58:26 -0500 (EST) Received: by mail (OpenSMTPD) with ESMTPSA id 74dc463a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 1 Dec 2026 10:58:26 +0000 (UTC) Date: Tue, 1 Dec 2026 11:58:24 +0100 From: Patrick Steinhardt To: Justin Tobler Cc: git@vger.kernel.org Subject: Re: [PATCH 3/5] builtin/multi-pack-index: drop top-level options Message-ID: References: X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Nov 30, 2026 at 03:54:59PM -0600, Justin Tobler wrote: > When invoking git-multi-pack-index(1), the "--object-dir=" and > "--[no-]progress" options can be given either before or after the > subcommand. This calling convention is atypical for Git commands, and it > requires the options parsed by `cmd_multi_pack_index()` to be stored in > global state so that they can be accessed by the subcommands. Neither > option needs to be accepted before the subcommand though. Ah, this essentially does the same change that I'm also doing for git-rerere(1) in an in-flight patch series. I'm obviously in favor of such changes -- they break backwards compatibility, but if you ask me it's a sensible change to make us more consistent. > The "--[no-]progress" option was already removed from the top-level > builtin in 0394f8d002 (builtin/multi-pack-index.c: disable top-level > --[no-]progress, 2021-09-20). When given before the subcommand, the > option is not always respected, as each subcommand overrides it > depending on whether stderr is connected to a terminal. Furthermore, a > subcommand without a notion of progress would have to ignore the option > altogether. The option was inadvertently reintroduced by 6b8fb17490 > (builtin/multi-pack-index.c: make '--progress' a common option, > 2026-02-24), which moved it into the common options that are also parsed > by `cmd_multi_pack_index()`. Consequently, "git multi-pack-index > --no-progress write" still shows progress when stderr is connected to a > terminal. Heh, fun. > diff --git a/Documentation/git-multi-pack-index.adoc b/Documentation/git-multi-pack-index.adoc > index c6d23aeeb9a0..0dd675f3fd46 100644 > --- a/Documentation/git-multi-pack-index.adoc > +++ b/Documentation/git-multi-pack-index.adoc > @@ -9,16 +9,16 @@ git-multi-pack-index - Write and verify multi-pack-indexes > SYNOPSIS > -------- > [verse] > -'git multi-pack-index' [] write [--preferred-pack=] > +'git multi-pack-index' write [] [--preferred-pack=] Is the `[]` placeholder even required now? We already list all the options, don't we? > diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c > index 8528f4f513ef..2b4e2f0cce9e 100644 > --- a/builtin/multi-pack-index.c > +++ b/builtin/multi-pack-index.c > @@ -415,7 +415,7 @@ int cmd_multi_pack_index(int argc, > { > int res; > parse_opt_subcommand_fn *fn = NULL; > - struct option builtin_multi_pack_index_options[] = { > + struct option options[] = { > OPT_SUBCOMMAND("repack", &fn, cmd_multi_pack_index_repack), > OPT_SUBCOMMAND("write", &fn, cmd_multi_pack_index_write), > OPT_SUBCOMMAND("compact", &fn, cmd_multi_pack_index_compact), > @@ -423,7 +423,6 @@ int cmd_multi_pack_index(int argc, > OPT_SUBCOMMAND("expire", &fn, cmd_multi_pack_index_expire), > OPT_END(), > }; > - struct option *options = parse_options_concat(builtin_multi_pack_index_options, common_opts); > > disable_replace_refs(); > > @@ -431,7 +430,6 @@ int cmd_multi_pack_index(int argc, > > argc = parse_options(argc, argv, prefix, options, > builtin_multi_pack_index_usage, 0); > - FREE_AND_NULL(options); > > res = fn(argc, argv, prefix, repo); > I really dislike this `parse_options_concat()` pattern. We can also easily replace it by defininging something like: #define MULTI_PACK_INDEX_COMMON_OPTIONS(var) \ OPT_FOO(...), \ OPT_BAR(...) And then you simply add it to the options at compile time. So maybe that's another refactoring we could add in a subsequent patch? ... Ah, you already do in your next patch. Great! Patrick