builtin/show-ref: explicitly spell out different modes in synopsis
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>
Patrick Steinhardt committed
Oct 31, 2023 at 09:16 UTC
1307d5e86fc7ea6f4352a70c24c6277a2f9939a3
2 files changed
+10
-4
Documentation/git-show-ref.txt
+6
-3
@@ -8,9 +8,12 @@ git-show-ref - List references in a local repository
8
SYNOPSIS
9
--------
10
[verse]
11
-'git show-ref' [-q | --quiet] [--verify] [--head] [-d | --dereference]
11
+'git show-ref' [--head] [-d | --dereference]
12
[-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]
13
[--heads] [--] [<pattern>...]
14
+'git show-ref' --verify [-q | --quiet] [-d | --dereference]
15
+ [-s | --hash[=<n>]] [--abbrev[=<n>]]
16
+ [--] [<ref>...]
17
'git show-ref' --exclude-existing[=<pattern>]
18
19
DESCRIPTION
@@ -70,8 +73,8 @@ OPTIONS
73
-q::
74
--quiet::
75
73
- Do not print any results to stdout. When combined with `--verify`, this
74
- can be used to silently check if a reference exists.
76
+ Do not print any results to stdout. Can be used with `--verify` to
77
+ silently check if a reference exists.
78
79
--exclude-existing[=<pattern>]::
80
builtin/show-ref.c
+4
-1
@@ -11,9 +11,12 @@
11
#include "parse-options.h"
12
13
static const char * const show_ref_usage[] = {
14
- N_("git show-ref [-q | --quiet] [--verify] [--head] [-d | --dereference]\n"
14
+ N_("git show-ref [--head] [-d | --dereference]\n"
15
" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
16
" [--heads] [--] [<pattern>...]"),
17
+ N_("git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
18
+ " [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
19
+ " [--] [<ref>...]"),
20
N_("git show-ref --exclude-existing[=<pattern>]"),
21
NULL
22
};