Skip to content

Commit 1307d5e

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 199970e commit 1307d5e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Documentation/git-show-ref.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ git-show-ref - List references in a local repository
88
SYNOPSIS
99
--------
1010
[verse]
11-
'git show-ref' [-q | --quiet] [--verify] [--head] [-d | --dereference]
11+
'git show-ref' [--head] [-d | --dereference]
1212
[-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]
1313
[--heads] [--] [<pattern>...]
14+
'git show-ref' --verify [-q | --quiet] [-d | --dereference]
15+
[-s | --hash[=<n>]] [--abbrev[=<n>]]
16+
[--] [<ref>...]
1417
'git show-ref' --exclude-existing[=<pattern>]
1518

1619
DESCRIPTION
@@ -70,8 +73,8 @@ OPTIONS
7073
-q::
7174
--quiet::
7275

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.
7578

7679
--exclude-existing[=<pattern>]::
7780

builtin/show-ref.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
#include "parse-options.h"
1212

1313
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"
1515
" [-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]\n"
1616
" [--heads] [--] [<pattern>...]"),
17+
N_("git show-ref --verify [-q | --quiet] [-d | --dereference]\n"
18+
" [-s | --hash[=<n>]] [--abbrev[=<n>]]\n"
19+
" [--] [<ref>...]"),
1720
N_("git show-ref --exclude-existing[=<pattern>]"),
1821
NULL
1922
};

0 commit comments

Comments
 (0)