From patchwork Thu Oct 26 09:57:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13437424 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 052392AB2C for ; Thu, 26 Oct 2023 09:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="LSu/kLLj"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="d1JEESUT" Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B13FD9D for ; Thu, 26 Oct 2023 02:57:05 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id DD96132009FB; Thu, 26 Oct 2023 05:57:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 26 Oct 2023 05:57:05 -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:sender :subject:subject:to:to; s=fm3; t=1698314224; x=1698400624; bh=3O 8z3KuuDmwSmlLeG4kB6BOGHumzN+SakJtG5c6mPxw=; b=LSu/kLLjGJTm6ny43k vEcoHYLxKn3li6JyxmKKpinkF4c8s4HAyOeNtIwCDJPerNTsMvkmol8iMwuKlX9b r8svnscJb02mrZFK9wHGIsqmWuj4zokG4oABgFwI1pQKBrJucHx65rFW0SHEXXRc c8s7nnTw8KkYOzZh0MbuljjeGskPCx0LKxOK7VVrWvLkYM7CTUpugkjPh6SQOc0K 9vtTw6Q65zFuigoFaq6cpwRgFM3cnFExBJndRIH/zjwhZzH84dmcHeKnwmq7bQdn TncmbCImlMXqSQJjt/DO8isV9zeEnMykoIXKu32YUpYsDTMpruq+JrYgBkNr+F8C g/bA== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698314224; x=1698400624; bh=3O8z3KuuDmwSm lLeG4kB6BOGHumzN+SakJtG5c6mPxw=; b=d1JEESUTEnucBLVo8LnnMT7ve4fgu FbnvNfzaDMyXjRxy0GezwTWNdml8JsGXDSEe2IkVKV9CgkjNNlMCFGorzaQBCOU3 PpOEPRzvRSXnNQLii/8y/UM+/nXPRTaR2X8F44Z6GR6aEuXD/V0SdRWIJFsYBhJg AszPGixZliO0x2h0evUgnf29/RhdyXkpdJl4hyFccabFp/Y1tWwXw5cSvxGdH21P Y6kN+ULP31PhJ7/uOLWHhxJjV1judeh1Az3nTf/nprOZXLMaWlxryg/V4Eua5U/s ibg3HQSPqzD90BtYmGWKRGja7ZvRrAoZ+zmJfTDaW+8v1aWWThnT7wqBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrledvgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleffteen ucevlhhushhtvghrufhiiigvpeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesph hkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Oct 2023 05:57:03 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 210335e2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 26 Oct 2023 09:56:54 +0000 (UTC) Date: Thu, 26 Oct 2023 11:57:01 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Junio C Hamano , Eric Sunshine , Han-Wen Nienhuys Subject: [PATCH v2 10/12] builtin/show-ref: explicitly spell out different modes in synopsis Message-ID: 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: The synopsis treats the `--verify` and the implicit mode the same. They are slightly different though: - They accept different sets of flags. - The implicit mode accepts patterns while the `--verify` mode accepts references. Split up the synopsis for these two modes such that we can disambiguate those differences. While at it, drop "--quiet" from the pattern mode's synopsis. It does not make a lot of sense to list patterns, but squelch the listing output itself. The description for "--quiet" is adapted accordingly. Signed-off-by: Patrick Steinhardt --- Documentation/git-show-ref.txt | 9 ++++++--- builtin/show-ref.c | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt index 2fe274b8faa..22f5ebc6a92 100644 --- a/Documentation/git-show-ref.txt +++ b/Documentation/git-show-ref.txt @@ -8,9 +8,12 @@ git-show-ref - List references in a local repository SYNOPSIS -------- [verse] -'git show-ref' [-q | --quiet] [--verify] [--head] [-d | --dereference] +'git show-ref' [--head] [-d | --dereference] [-s | --hash[=]] [--abbrev[=]] [--tags] [--heads] [--] [...] +'git show-ref' --verify [-q | --quiet] [-d | --dereference] + [-s | --hash[=]] [--abbrev[=]] + [--] [...] 'git show-ref' --exclude-existing[=] DESCRIPTION @@ -70,8 +73,8 @@ OPTIONS -q:: --quiet:: - Do not print any results to stdout. When combined with `--verify`, this - can be used to silently check if a reference exists. + Do not print any results to stdout. Can be used with `--verify` to + silently check if a reference exists. --exclude-existing[=]:: diff --git a/builtin/show-ref.c b/builtin/show-ref.c index 1768aef77b3..d4561d7ce1f 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -11,9 +11,12 @@ #include "parse-options.h" static const char * const show_ref_usage[] = { - N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference]\n" + N_("git show-ref [--head] [-d | --dereference]\n" " [-s | --hash[=]] [--abbrev[=]] [--tags]\n" " [--heads] [--] [...]"), + N_("git show-ref --verify [-q | --quiet] [-d | --dereference]\n" + " [-s | --hash[=]] [--abbrev[=]]\n" + " [--] [...]"), N_("git show-ref --exclude-existing[=]"), NULL };