From 8c9e292dc091e637eeb78fb0046c3572717b4a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 13 Oct 2022 17:39:13 +0200 Subject: [PATCH] doc txt & -h consistency: add missing options and labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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=) As we can specify "--sort" multiple times (it's backed by a string-list" it should really be "[(--sort=)...]", 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 Signed-off-by: Junio C Hamano --- Documentation/git-send-pack.txt | 3 ++- Documentation/git-sparse-checkout.txt | 2 +- Documentation/git-update-server-info.txt | 8 +++++++- Documentation/git-verify-commit.txt | 2 +- Documentation/git-verify-tag.txt | 2 +- builtin/credential-cache--daemon.c | 2 +- builtin/describe.c | 5 +++-- builtin/diff-index.c | 2 +- builtin/ls-remote.c | 2 +- builtin/pack-refs.c | 2 +- builtin/revert.c | 9 +++++---- builtin/send-pack.c | 1 + builtin/symbolic-ref.c | 5 +++-- builtin/tag.c | 10 ++++++---- builtin/update-server-info.c | 2 +- builtin/upload-pack.c | 3 ++- builtin/verify-commit.c | 2 +- builtin/verify-tag.c | 2 +- help.c | 2 +- 19 files changed, 40 insertions(+), 26 deletions(-) diff --git a/Documentation/git-send-pack.txt b/Documentation/git-send-pack.txt index e0c7162343..595b002152 100644 --- a/Documentation/git-send-pack.txt +++ b/Documentation/git-send-pack.txt @@ -9,7 +9,8 @@ git-send-pack - Push objects over Git protocol to another repository SYNOPSIS -------- [verse] -'git send-pack' [--dry-run] [--force] [--receive-pack=] +'git send-pack' [--mirror] [--dry-run] [--force] + [--receive-pack=] [--verbose] [--thin] [--atomic] [--[no-]signed | --signed=(true|false|if-asked)] [:] (--all | ...) diff --git a/Documentation/git-sparse-checkout.txt b/Documentation/git-sparse-checkout.txt index 872436d742..68392d2a56 100644 --- a/Documentation/git-sparse-checkout.txt +++ b/Documentation/git-sparse-checkout.txt @@ -9,7 +9,7 @@ git-sparse-checkout - Reduce your working tree to a subset of tracked files SYNOPSIS -------- [verse] -'git sparse-checkout' [] +'git sparse-checkout' (init | list | set | add | reapply | disable) [] DESCRIPTION diff --git a/Documentation/git-update-server-info.txt b/Documentation/git-update-server-info.txt index 969bb2e15f..17e429dbd0 100644 --- a/Documentation/git-update-server-info.txt +++ b/Documentation/git-update-server-info.txt @@ -9,7 +9,7 @@ git-update-server-info - Update auxiliary info file to help dumb servers SYNOPSIS -------- [verse] -'git update-server-info' +'git update-server-info' [-f | --force] DESCRIPTION ----------- @@ -19,6 +19,12 @@ $GIT_OBJECT_DIRECTORY/info directories to help clients discover what references and packs the server has. This command generates such auxiliary files. +OPTIONS +------- +-f:: +--force:: + update the info files from scratch. + OUTPUT ------ diff --git a/Documentation/git-verify-commit.txt b/Documentation/git-verify-commit.txt index 92097f6673..aee4c40eac 100644 --- a/Documentation/git-verify-commit.txt +++ b/Documentation/git-verify-commit.txt @@ -8,7 +8,7 @@ git-verify-commit - Check the GPG signature of commits SYNOPSIS -------- [verse] -'git verify-commit' ... +'git verify-commit' [-v | --verbose] [--raw] ... DESCRIPTION ----------- diff --git a/Documentation/git-verify-tag.txt b/Documentation/git-verify-tag.txt index 0b8075dad9..81d50ecc4c 100644 --- a/Documentation/git-verify-tag.txt +++ b/Documentation/git-verify-tag.txt @@ -8,7 +8,7 @@ git-verify-tag - Check the GPG signature of tags SYNOPSIS -------- [verse] -'git verify-tag' [--format=] ... +'git verify-tag' [-v | --verbose] [--format=] [--raw] ... DESCRIPTION ----------- diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c index ca672a6a61..d4eb0097d2 100644 --- a/builtin/credential-cache--daemon.c +++ b/builtin/credential-cache--daemon.c @@ -267,7 +267,7 @@ int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix) const char *socket_path; int ignore_sighup = 0; static const char *usage[] = { - "git-credential-cache--daemon [opts] ", + "git-credential-cache--daemon [--debug] ", NULL }; int debug = 0; diff --git a/builtin/describe.c b/builtin/describe.c index a76f1a1a7a..98fb8afc3f 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -23,8 +23,9 @@ define_commit_slab(commit_names, struct commit_name *); static const char * const describe_usage[] = { - N_("git describe [] [...]"), - N_("git describe [] --dirty"), + N_("git describe [--all] [--tags] [--contains] [--abbrev=] [...]"), + N_("git describe [--all] [--tags] [--contains] [--abbrev=] --dirty[=]"), + N_("git describe "), NULL }; diff --git a/builtin/diff-index.c b/builtin/diff-index.c index e667cf52e7..aea139b9d8 100644 --- a/builtin/diff-index.c +++ b/builtin/diff-index.c @@ -9,7 +9,7 @@ #include "submodule.h" static const char diff_cache_usage[] = -"git diff-index [-m] [--cached] " +"git diff-index [-m] [--cached] [--merge-base] " "[] [...]" "\n" COMMON_DIFF_OPTIONS_HELP; diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c index df44e5cc0d..5d5ac03871 100644 --- a/builtin/ls-remote.c +++ b/builtin/ls-remote.c @@ -7,7 +7,7 @@ static const char * const ls_remote_usage[] = { N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=]\n" - " [-q | --quiet] [--exit-code] [--get-url]\n" + " [-q | --quiet] [--exit-code] [--get-url] [--sort=]\n" " [--symref] [ [...]]"), NULL }; diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index cfbd5c36c7..27c2ca06ac 100644 --- a/builtin/pack-refs.c +++ b/builtin/pack-refs.c @@ -5,7 +5,7 @@ #include "repository.h" static char const * const pack_refs_usage[] = { - N_("git pack-refs []"), + N_("git pack-refs [--all] [--no-prune]"), NULL }; diff --git a/builtin/revert.c b/builtin/revert.c index ee2a0807f0..ee32c714a7 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -21,14 +21,15 @@ */ static const char * const revert_usage[] = { - N_("git revert [] ..."), - N_("git revert "), + N_("git revert [--[no-]edit] [-n] [-m parent-number] [-s] [-S[]] ..."), + N_("git revert (--continue | --skip | --abort | --quit)"), NULL }; static const char * const cherry_pick_usage[] = { - N_("git cherry-pick [] ..."), - N_("git cherry-pick "), + N_("git cherry-pick [--edit] [-n] [-m ] [-s] [-x] [--ff]\n" + " [-S[]] ..."), + N_("git cherry-pick (--continue | --skip | --abort | --quit)"), NULL }; diff --git a/builtin/send-pack.c b/builtin/send-pack.c index 64962be016..4c5d125fa0 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -20,6 +20,7 @@ static const char * const send_pack_usage[] = { N_("git send-pack [--mirror] [--dry-run] [--force]\n" " [--receive-pack=]\n" " [--verbose] [--thin] [--atomic]\n" + " [--[no-]signed | --signed=(true|false|if-asked)]\n" " [:] (--all | ...)"), NULL, }; diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c index 1b0f10225f..50b6df78df 100644 --- a/builtin/symbolic-ref.c +++ b/builtin/symbolic-ref.c @@ -5,8 +5,9 @@ #include "parse-options.h" static const char * const git_symbolic_ref_usage[] = { - N_("git symbolic-ref [] []"), - N_("git symbolic-ref -d [-q] "), + N_("git symbolic-ref [-m ] "), + N_("git symbolic-ref [-q] [--short] "), + N_("git symbolic-ref --delete [-q] "), NULL }; diff --git a/builtin/tag.c b/builtin/tag.c index 75dece0e4f..d428c45dc8 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -23,11 +23,13 @@ #include "date.h" static const char * const git_tag_usage[] = { - N_("git tag [-a | -s | -u ] [-f] [-m | -F ]\n" - " []"), + N_("git tag [-a | -s | -u ] [-f] [-m | -F ] [-e]\n" + " [ | ]"), N_("git tag -d ..."), - N_("git tag -l [-n[]] [--contains ] [--no-contains ] [--points-at ]\n" - " [--format=] [--merged ] [--no-merged ] [...]"), + N_("git tag [-n[]] -l [--contains ] [--no-contains ]\n" + " [--points-at ] [--column[=] | --no-column]\n" + " [--create-reflog] [--sort=] [--format=]\n" + " [--merged ] [--no-merged ] [...]"), N_("git tag -v [--format=] ..."), NULL }; diff --git a/builtin/update-server-info.c b/builtin/update-server-info.c index 880fffec58..d2239c9ef4 100644 --- a/builtin/update-server-info.c +++ b/builtin/update-server-info.c @@ -4,7 +4,7 @@ #include "parse-options.h" static const char * const update_server_info_usage[] = { - "git update-server-info [--force]", + "git update-server-info [-f | --force]", NULL }; diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c index 125af53885..25b69da2bf 100644 --- a/builtin/upload-pack.c +++ b/builtin/upload-pack.c @@ -8,7 +8,8 @@ #include "serve.h" static const char * const upload_pack_usage[] = { - N_("git upload-pack [] "), + N_("git-upload-pack [--[no-]strict] [--timeout=] [--stateless-rpc]\n" + " [--advertise-refs] "), NULL }; diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c index 40c69a0bed..3ebad32b0f 100644 --- a/builtin/verify-commit.c +++ b/builtin/verify-commit.c @@ -16,7 +16,7 @@ #include "gpg-interface.h" static const char * const verify_commit_usage[] = { - N_("git verify-commit [-v | --verbose] ..."), + N_("git verify-commit [-v | --verbose] [--raw] ..."), NULL }; diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c index f45136a06b..217566952d 100644 --- a/builtin/verify-tag.c +++ b/builtin/verify-tag.c @@ -15,7 +15,7 @@ #include "ref-filter.h" static const char * const verify_tag_usage[] = { - N_("git verify-tag [-v | --verbose] [--format=] ..."), + N_("git verify-tag [-v | --verbose] [--format=] [--raw] ..."), NULL }; diff --git a/help.c b/help.c index 991e33f8a6..0dd5b98022 100644 --- a/help.c +++ b/help.c @@ -757,7 +757,7 @@ int cmd_version(int argc, const char **argv, const char *prefix) struct strbuf buf = STRBUF_INIT; int build_options = 0; const char * const usage[] = { - N_("git version []"), + N_("git version [--build-options]"), NULL }; struct option options[] = {