doc txt & -h consistency: add missing options and labels

Fix various issues of SYNOPSIS and -h output syntax where: * Options such as --force were missing entirely * ...or the short option, such as -f * We said "opts" or "options", but could instead enumerate the (small) set of supported options * Options that were missing entirely (ls-remote's --sort=<key>) As we can specify "--sort" multiple times (it's backed by a string-list" it should really be "[(--sort=<key>)...]", which is what "git for-each-ref" lists it as, but let's leave that issue for a subsequent cleanup, and stop at making these consistent. Other "ref-filter.h" users share the same issue, e.g. "git-branch.txt". * For "verify-tag" and "verify-commit" we were missing the "--raw" option. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Oct 13, 2022 at 17:39 UTC 8c9e292dc091e637eeb78fb0046c3572717b4a67
19 files changed +40 -26
Documentation/git-send-pack.txt
+2 -1
@@ -9,7 +9,8 @@ git-send-pack - Push objects over Git protocol to another repository
9 SYNOPSIS
10 --------
11 [verse]
12 -'git send-pack' [--dry-run] [--force] [--receive-pack=<git-receive-pack>]
12 +'git send-pack' [--mirror] [--dry-run] [--force]
13 + [--receive-pack=<git-receive-pack>]
14 [--verbose] [--thin] [--atomic]
15 [--[no-]signed | --signed=(true|false|if-asked)]
16 [<host>:]<directory> (--all | <ref>...)
Documentation/git-sparse-checkout.txt
+1 -1
@@ -9,7 +9,7 @@ git-sparse-checkout - Reduce your working tree to a subset of tracked files
9 SYNOPSIS
10 --------
11 [verse]
12 -'git sparse-checkout' <subcommand> [<options>]
12 +'git sparse-checkout' (init | list | set | add | reapply | disable) [<options>]
13
14
15 DESCRIPTION
Documentation/git-update-server-info.txt
+7 -1
@@ -9,7 +9,7 @@ git-update-server-info - Update auxiliary info file to help dumb servers
9 SYNOPSIS
10 --------
11 [verse]
12 -'git update-server-info'
12 +'git update-server-info' [-f | --force]
13
14 DESCRIPTION
15 -----------
@@ -19,6 +19,12 @@ $GIT_OBJECT_DIRECTORY/info directories to help clients discover
19 what references and packs the server has. This command
20 generates such auxiliary files.
21
22 +OPTIONS
23 +-------
24 +-f::
25 +--force::
26 + update the info files from scratch.
27 +
28 OUTPUT
29 ------
30
Documentation/git-verify-commit.txt
+1 -1
@@ -8,7 +8,7 @@ git-verify-commit - Check the GPG signature of commits
8 SYNOPSIS
9 --------
10 [verse]
11 -'git verify-commit' <commit>...
11 +'git verify-commit' [-v | --verbose] [--raw] <commit>...
12
13 DESCRIPTION
14 -----------
Documentation/git-verify-tag.txt
+1 -1
@@ -8,7 +8,7 @@ git-verify-tag - Check the GPG signature of tags
8 SYNOPSIS
9 --------
10 [verse]
11 -'git verify-tag' [--format=<format>] <tag>...
11 +'git verify-tag' [-v | --verbose] [--format=<format>] [--raw] <tag>...
12
13 DESCRIPTION
14 -----------
builtin/credential-cache--daemon.c
+1 -1
@@ -267,7 +267,7 @@ int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
267 const char *socket_path;
268 int ignore_sighup = 0;
269 static const char *usage[] = {
270 - "git-credential-cache--daemon [opts] <socket-path>",
270 + "git-credential-cache--daemon [--debug] <socket-path>",
271 NULL
272 };
273 int debug = 0;
builtin/describe.c
+3 -2
@@ -23,8 +23,9 @@
23 define_commit_slab(commit_names, struct commit_name *);
24
25 static const char * const describe_usage[] = {
26 - N_("git describe [<options>] [<commit-ish>...]"),
27 - N_("git describe [<options>] --dirty"),
26 + N_("git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]"),
27 + N_("git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]"),
28 + N_("git describe <blob>"),
29 NULL
30 };
31
builtin/diff-index.c
+1 -1
@@ -9,7 +9,7 @@
9 #include "submodule.h"
10
11 static const char diff_cache_usage[] =
12 -"git diff-index [-m] [--cached] "
12 +"git diff-index [-m] [--cached] [--merge-base] "
13 "[<common-diff-options>] <tree-ish> [<path>...]"
14 "\n"
15 COMMON_DIFF_OPTIONS_HELP;
builtin/ls-remote.c
+1 -1
@@ -7,7 +7,7 @@
7
8 static const char * const ls_remote_usage[] = {
9 N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
10 - " [-q | --quiet] [--exit-code] [--get-url]\n"
10 + " [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
11 " [--symref] [<repository> [<refs>...]]"),
12 NULL
13 };
builtin/pack-refs.c
+1 -1
@@ -5,7 +5,7 @@
5 #include "repository.h"
6
7 static char const * const pack_refs_usage[] = {
8 - N_("git pack-refs [<options>]"),
8 + N_("git pack-refs [--all] [--no-prune]"),
9 NULL
10 };
11
builtin/revert.c
+5 -4
@@ -21,14 +21,15 @@
21 */
22
23 static const char * const revert_usage[] = {
24 - N_("git revert [<options>] <commit-ish>..."),
25 - N_("git revert <subcommand>"),
24 + N_("git revert [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>..."),
25 + N_("git revert (--continue | --skip | --abort | --quit)"),
26 NULL
27 };
28
29 static const char * const cherry_pick_usage[] = {
30 - N_("git cherry-pick [<options>] <commit-ish>..."),
31 - N_("git cherry-pick <subcommand>"),
30 + N_("git cherry-pick [--edit] [-n] [-m <parent-number>] [-s] [-x] [--ff]\n"
31 + " [-S[<keyid>]] <commit>..."),
32 + N_("git cherry-pick (--continue | --skip | --abort | --quit)"),
33 NULL
34 };
35
builtin/send-pack.c
+1
@@ -20,6 +20,7 @@ static const char * const send_pack_usage[] = {
20 N_("git send-pack [--mirror] [--dry-run] [--force]\n"
21 " [--receive-pack=<git-receive-pack>]\n"
22 " [--verbose] [--thin] [--atomic]\n"
23 + " [--[no-]signed | --signed=(true|false|if-asked)]\n"
24 " [<host>:]<directory> (--all | <ref>...)"),
25 NULL,
26 };
builtin/symbolic-ref.c
+3 -2
@@ -5,8 +5,9 @@
5 #include "parse-options.h"
6
7 static const char * const git_symbolic_ref_usage[] = {
8 - N_("git symbolic-ref [<options>] <name> [<ref>]"),
9 - N_("git symbolic-ref -d [-q] <name>"),
8 + N_("git symbolic-ref [-m <reason>] <name> <ref>"),
9 + N_("git symbolic-ref [-q] [--short] <name>"),
10 + N_("git symbolic-ref --delete [-q] <name>"),
11 NULL
12 };
13
builtin/tag.c
+6 -4
@@ -23,11 +23,13 @@
23 #include "date.h"
24
25 static const char * const git_tag_usage[] = {
26 - N_("git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>]\n"
27 - " <tagname> [<head>]"),
26 + N_("git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
27 + " <tagname> [<commit> | <object>]"),
28 N_("git tag -d <tagname>..."),
29 - N_("git tag -l [-n[<num>]] [--contains <commit>] [--no-contains <commit>] [--points-at <object>]\n"
30 - " [--format=<format>] [--merged <commit>] [--no-merged <commit>] [<pattern>...]"),
29 + N_("git tag [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]\n"
30 + " [--points-at <object>] [--column[=<options>] | --no-column]\n"
31 + " [--create-reflog] [--sort=<key>] [--format=<format>]\n"
32 + " [--merged <commit>] [--no-merged <commit>] [<pattern>...]"),
33 N_("git tag -v [--format=<format>] <tagname>..."),
34 NULL
35 };
builtin/update-server-info.c
+1 -1
@@ -4,7 +4,7 @@
4 #include "parse-options.h"
5
6 static const char * const update_server_info_usage[] = {
7 - "git update-server-info [--force]",
7 + "git update-server-info [-f | --force]",
8 NULL
9 };
10
builtin/upload-pack.c
+2 -1
@@ -8,7 +8,8 @@
8 #include "serve.h"
9
10 static const char * const upload_pack_usage[] = {
11 - N_("git upload-pack [<options>] <dir>"),
11 + N_("git-upload-pack [--[no-]strict] [--timeout=<n>] [--stateless-rpc]\n"
12 + " [--advertise-refs] <directory>"),
13 NULL
14 };
15
builtin/verify-commit.c
+1 -1
@@ -16,7 +16,7 @@
16 #include "gpg-interface.h"
17
18 static const char * const verify_commit_usage[] = {
19 - N_("git verify-commit [-v | --verbose] <commit>..."),
19 + N_("git verify-commit [-v | --verbose] [--raw] <commit>..."),
20 NULL
21 };
22
builtin/verify-tag.c
+1 -1
@@ -15,7 +15,7 @@
15 #include "ref-filter.h"
16
17 static const char * const verify_tag_usage[] = {
18 - N_("git verify-tag [-v | --verbose] [--format=<format>] <tag>..."),
18 + N_("git verify-tag [-v | --verbose] [--format=<format>] [--raw] <tag>..."),
19 NULL
20 };
21
help.c
+1 -1
@@ -757,7 +757,7 @@ int cmd_version(int argc, const char **argv, const char *prefix)
757 struct strbuf buf = STRBUF_INIT;
758 int build_options = 0;
759 const char * const usage[] = {
760 - N_("git version [<options>]"),
760 + N_("git version [--build-options]"),
761 NULL
762 };
763 struct option options[] = {