diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-10-13 17:39:19 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-10-13 09:32:57 -0700 |
| commit | 951ec747d47e70c40625f2d37173584db4a0e13e (patch) | |
| tree | ae7275222ad1feec21e07257d15cac09f05f77ca | |
| parent | doc txt & -h consistency: add missing options (diff) | |
| download | git-951ec747d47e70c40625f2d37173584db4a0e13e.tar.gz git-951ec747d47e70c40625f2d37173584db4a0e13e.zip | |
doc txt & -h consistency: make "stash" consistent
Amend both the -h output and *.txt to match one another. In this case
the *.txt didn't list the "save" subcommand, and the "-h" was
similarly missing some commands.
Let's also convert the *.c code to use a macro definition, similar to
that used in preceding commits. This avoids duplication.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rw-r--r-- | Documentation/git-stash.txt | 5 | ||||
| -rw-r--r-- | builtin/stash.c | 73 |
2 files changed, 52 insertions, 26 deletions
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index 379bea645d..c350a3b8da 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -11,12 +11,15 @@ SYNOPSIS 'git stash' list [<log-options>] 'git stash' show [-u | --include-untracked | --only-untracked] [<diff-options>] [<stash>] 'git stash' drop [-q | --quiet] [<stash>] -'git stash' (pop | apply) [--index] [-q | --quiet] [<stash>] +'git stash' pop [--index] [-q | --quiet] [<stash>] +'git stash' apply [--index] [-q | --quiet] [<stash>] 'git stash' branch <branchname> [<stash>] 'git stash' [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] [-u | --include-untracked] [-a | --all] [(-m | --message) <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]] +'git stash' save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet] + [-u | --include-untracked] [-a | --all] [<message>] 'git stash' clear 'git stash' create [<message>] 'git stash' store [(-m | --message) <message>] [-q | --quiet] <commit> diff --git a/builtin/stash.c b/builtin/stash.c index 614bb0dd4a..7cc2b403d5 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -21,72 +21,95 @@ #define INCLUDE_ALL_FILES 2 +#define BUILTIN_STASH_LIST_USAGE \ + N_("git stash list [<log-options>]") +#define BUILTIN_STASH_SHOW_USAGE \ + N_("git stash show [-u | --include-untracked | --only-untracked] [<diff-options>] [<stash>]") +#define BUILTIN_STASH_DROP_USAGE \ + N_("git stash drop [-q | --quiet] [<stash>]") +#define BUILTIN_STASH_POP_USAGE \ + N_("git stash pop [--index] [-q | --quiet] [<stash>]") +#define BUILTIN_STASH_APPLY_USAGE \ + N_("git stash apply [--index] [-q | --quiet] [<stash>]") +#define BUILTIN_STASH_BRANCH_USAGE \ + N_("git stash branch <branchname> [<stash>]") +#define BUILTIN_STASH_STORE_USAGE \ + N_("git stash store [(-m | --message) <message>] [-q | --quiet] <commit>") +#define BUILTIN_STASH_PUSH_USAGE \ + N_("git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n" \ + " [-u | --include-untracked] [-a | --all] [(-m | --message) <message>]\n" \ + " [--pathspec-from-file=<file> [--pathspec-file-nul]]\n" \ + " [--] [<pathspec>...]]") +#define BUILTIN_STASH_SAVE_USAGE \ + N_("git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n" \ + " [-u | --include-untracked] [-a | --all] [<message>]") +#define BUILTIN_STASH_CREATE_USAGE \ + N_("git stash create [<message>]") +#define BUILTIN_STASH_CLEAR_USAGE \ + "git stash clear" + static const char * const git_stash_usage[] = { - N_("git stash list [<log-options>]"), - N_("git stash show [<options>] [<stash>]"), - N_("git stash drop [-q | --quiet] [<stash>]"), - N_("git stash (pop | apply) [--index] [-q | --quiet] [<stash>]"), - N_("git stash branch <branchname> [<stash>]"), - "git stash clear", - N_("git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n" - " [-u | --include-untracked] [-a | --all] [(-m | --message) <message>]\n" - " [--pathspec-from-file=<file> [--pathspec-file-nul]]\n" - " [--] [<pathspec>...]]"), - N_("git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n" - " [-u | --include-untracked] [-a | --all] [<message>]"), + BUILTIN_STASH_LIST_USAGE, + BUILTIN_STASH_SHOW_USAGE, + BUILTIN_STASH_DROP_USAGE, + BUILTIN_STASH_POP_USAGE, + BUILTIN_STASH_APPLY_USAGE, + BUILTIN_STASH_BRANCH_USAGE, + BUILTIN_STASH_PUSH_USAGE, + BUILTIN_STASH_SAVE_USAGE, + BUILTIN_STASH_CLEAR_USAGE, + BUILTIN_STASH_CREATE_USAGE, + BUILTIN_STASH_STORE_USAGE, NULL }; static const char * const git_stash_list_usage[] = { - N_("git stash list [<options>]"), + BUILTIN_STASH_LIST_USAGE, NULL }; static const char * const git_stash_show_usage[] = { - N_("git stash show [<options>] [<stash>]"), + BUILTIN_STASH_SHOW_USAGE, NULL }; static const char * const git_stash_drop_usage[] = { - N_("git stash drop [-q | --quiet] [<stash>]"), + BUILTIN_STASH_DROP_USAGE, NULL }; static const char * const git_stash_pop_usage[] = { - N_("git stash pop [--index] [-q | --quiet] [<stash>]"), + BUILTIN_STASH_POP_USAGE, NULL }; static const char * const git_stash_apply_usage[] = { - N_("git stash apply [--index] [-q | --quiet] [<stash>]"), + BUILTIN_STASH_APPLY_USAGE, NULL }; static const char * const git_stash_branch_usage[] = { - N_("git stash branch <branchname> [<stash>]"), + BUILTIN_STASH_BRANCH_USAGE, NULL }; static const char * const git_stash_clear_usage[] = { - "git stash clear", + BUILTIN_STASH_CLEAR_USAGE, NULL }; static const char * const git_stash_store_usage[] = { - N_("git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"), + BUILTIN_STASH_STORE_USAGE, NULL }; static const char * const git_stash_push_usage[] = { - N_("git stash [push [-p | --patch] [-k | --[no-]keep-index] [-q | --quiet]\n" - " [-u | --include-untracked] [-a | --all] [(-m | --message) <message>]\n" - " [--] [<pathspec>...]]"), + BUILTIN_STASH_PUSH_USAGE, NULL }; static const char * const git_stash_save_usage[] = { - N_("git stash save [-p | --patch] [-k | --[no-]keep-index] [-q | --quiet]\n" - " [-u | --include-untracked] [-a | --all] [<message>]"), + BUILTIN_STASH_SAVE_USAGE, NULL }; |
