]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/show-ref: explicitly spell out different modes in synopsis
authorPatrick Steinhardt <ps@pks.im>
Tue, 31 Oct 2023 08:16:50 +0000 (09:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Nov 2023 03:09:00 +0000 (12:09 +0900)
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-show-ref.txt
builtin/show-ref.c

index 36e81b9dec45c08a19d5ef4d7840037923d02f8d..9afcd4d536d0f48695fc0459cbad7271256c1791 100644 (file)
@@ -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[=<n>]] [--abbrev[=<n>]] [--tags]
             [--heads] [--] [<pattern>...]
+'git show-ref' --verify [-q | --quiet] [-d | --dereference]
+            [-s | --hash[=<n>]] [--abbrev[=<n>]]
+            [--] [<ref>...]
 'git show-ref' --exclude-existing[=<pattern>]
 
 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[=<pattern>]::
 
index 6685495dd2c47331d00648736e18561691f988d8..460f238a62dbd962b9f147b1ca5fae4cc89185b3 100644 (file)
 #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[=<n>]] [--abbrev[=<n>]] [--tags]\n"
           "             [--heads] [--] [<pattern>...]"),
+       N_("git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
+          "             [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
+          "             [--] [<ref>...]"),
        N_("git show-ref --exclude-existing[=<pattern>]"),
        NULL
 };