From patchwork Mon May 6 08:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13655184 Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6CCA1422A7 for ; Mon, 6 May 2024 08:57:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714985824; cv=none; b=JpewAGUDg0EtDOvxBfP67JIlrweTqLPiW7Vr9VrysiAeH4YKAnJOjbtWhTkAY0PwL/hj2N37YVG+380e9Y9J2GjM6FMa/3qqayVClCGZ+zDaK+usoy90+BUQfhjCKoeZrYqA6vPTjodS1AYpkMtL7GxMiN/3GpDRsC8OT0QGuys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714985824; c=relaxed/simple; bh=8YV1WOX1PwIJoDkHtFa7J3R2eb5BToXiqs4c0K2Tqfg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fHRfVtUBE9KnBPNXOYA4+pszTbEKAT1XTvfN1yXa7k7N0oWgtyViH9AtRwk2MJT7LO2RjEdQUnqtmrdYkABcyzm0xZyhwEJPjUggntE9LvwrToOa53OBxOy7HZsisNC0O3EnpeTpEVh9Iz5FesnZbnaeg9DViDYJJVO3tjBBxuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=aS9X5U9l; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=WcEAUpMv; arc=none smtp.client-ip=64.147.123.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none 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) header.d=pks.im header.i=@pks.im header.b="aS9X5U9l"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="WcEAUpMv" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.west.internal (Postfix) with ESMTP id 7A07618000C6; Mon, 6 May 2024 04:57:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 06 May 2024 04:57:02 -0400 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=1714985821; x=1715072221; bh=/5d+HXocPQ RZnKc3WRy9DN7Viy5bRByg6Vdy87Ax0QA=; b=aS9X5U9lz2RfKyUCmF/TbCoGth ue98KZvRgiDW1TidBgBiDKw2aEjqbZcVNmNLWX7S16t959GUuLsGu1D6C7/2DyOM axTVQgqdgJyM5W51jiJJ7CXwHQxPyv34YYrl3SjCHCJV/tOW2TdWIjMS2Iy07wbr vU6R8ZwJ60uBR61XKQeESSAnhP/ZiaitEzgxllwUTHoPLyX13SqfXSP9fCJ0tVvu q/3cFsdOVozD+itThiUAoBpkfXwVnbzCKvgXdQYQ2Z2NarJbRO7bFiQlo6u0+6sL Ql7sRU53ZjCWlXU0DSkSErd00jBIjKjzRU23N4Gp9+JbbiYS4J76BAVUY57Q== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1714985821; x=1715072221; bh=/5d+HXocPQRZnKc3WRy9DN7Viy5b RByg6Vdy87Ax0QA=; b=WcEAUpMvEz63PW7d/jLUy7J8RvjjAaipagOAn+x5LFMp tcyhVukGMiKljRTOSACy6CTkGTsTZCBGib2qaqzxqUTpIjRf9eA69E3F2RTLeOWV rsLIAsfMmo0nphcXM2WX8se6qw52amIt/BrSNdY1Lxsi8/WtZvjqad0O4D8UuyMA vwaoosz1of0yLhyZJKPyTcCZNcewMGbiY/zTAmMjPoulPTiP1sakmagGcZSVmI6Y JkdyP0oOEWXNj7VGLE84q5K1Aa+tCMHj0f4HJUI3BdH5uWveo5cUrr2IN3dQh0HY JBlJJzFkAj17Bs9z/pMxuxiZxd85lKTbXVS7FidW6g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddviedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepueektdevtdffveeljeetgfehheeigeekleduvdeffeeghefgledttdehjeelffet necuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 May 2024 04:56:59 -0400 (EDT) Received: by localhost (OpenSMTPD) with ESMTPSA id 66896b9c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 6 May 2024 08:56:54 +0000 (UTC) Date: Mon, 6 May 2024 10:56:57 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Kristoffer Haugsbakk , Taylor Blau , =?iso-8859-1?q?Jean-No=EBl?= AVILA , Eric Sunshine , Junio C Hamano , Dragan Simic , rsbecker@nexbridge.com Subject: [PATCH v5 14/14] builtin/config: display subcommand help Message-ID: <97a48ab81dba0ab03cc3c1b648555a5fab79ee0a.1714982328.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Until now, `git config -h` would have printed help for the old-style syntax. Now that all modes have proper subcommands though it is preferable to instead display the subcommand help. Drop the `NO_INTERNAL_HELP` flag to do so. While at it, drop the help mismatch in t0450 and add the `--get-colorbool` option to the usage such that git-config(1)'s synopsis and `git config -h` match. Signed-off-by: Patrick Steinhardt --- builtin/config.c | 5 +++-- t/t0450/txt-help-mismatches | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/config.c b/builtin/config.c index 8f7fa8f31a..80aa9d8a66 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -23,6 +23,7 @@ static const char *const builtin_config_usage[] = { N_("git config rename-section [] "), N_("git config remove-section [] "), N_("git config edit []"), + N_("git config [] --get-colorbool []"), NULL }; @@ -1093,10 +1094,10 @@ int cmd_config(int argc, const char **argv, const char *prefix) * us when parsing the legacy-style modes that don't use subcommands. */ argc = parse_options(argc, argv, prefix, builtin_subcommand_options, builtin_config_usage, - PARSE_OPT_SUBCOMMAND_OPTIONAL|PARSE_OPT_NO_INTERNAL_HELP|PARSE_OPT_KEEP_ARGV0|PARSE_OPT_KEEP_UNKNOWN_OPT); + PARSE_OPT_SUBCOMMAND_OPTIONAL|PARSE_OPT_KEEP_ARGV0|PARSE_OPT_KEEP_UNKNOWN_OPT); if (subcommand) { argc = parse_options(argc, argv, prefix, builtin_subcommand_options, builtin_config_usage, - PARSE_OPT_SUBCOMMAND_OPTIONAL|PARSE_OPT_NO_INTERNAL_HELP|PARSE_OPT_KEEP_UNKNOWN_OPT); + PARSE_OPT_SUBCOMMAND_OPTIONAL|PARSE_OPT_KEEP_UNKNOWN_OPT); return subcommand(argc, argv, prefix); } diff --git a/t/t0450/txt-help-mismatches b/t/t0450/txt-help-mismatches index a0777acd66..28003f18c9 100644 --- a/t/t0450/txt-help-mismatches +++ b/t/t0450/txt-help-mismatches @@ -10,7 +10,6 @@ checkout checkout-index clone column -config credential credential-cache credential-store