Skip to content

Commit 951ec74

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d9054a1 commit 951ec74

File tree

2 files changed

+52
-26
lines changed

2 files changed

+52
-26
lines changed

Documentation/git-stash.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ SYNOPSIS
1111
'git stash' list [<log-options>]
1212
'git stash' show [-u | --include-untracked | --only-untracked] [<diff-options>] [<stash>]
1313
'git stash' drop [-q | --quiet] [<stash>]
14-
'git stash' (pop | apply) [--index] [-q | --quiet] [<stash>]
14+
'git stash' pop [--index] [-q | --quiet] [<stash>]
15+
'git stash' apply [--index] [-q | --quiet] [<stash>]
1516
'git stash' branch <branchname> [<stash>]
1617
'git stash' [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
1718
[-u | --include-untracked] [-a | --all] [(-m | --message) <message>]
1819
[--pathspec-from-file=<file> [--pathspec-file-nul]]
1920
[--] [<pathspec>...]]
21+
'git stash' save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
22+
[-u | --include-untracked] [-a | --all] [<message>]
2023
'git stash' clear
2124
'git stash' create [<message>]
2225
'git stash' store [(-m | --message) <message>] [-q | --quiet] <commit>

builtin/stash.c

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,72 +21,95 @@
2121

2222
#define INCLUDE_ALL_FILES 2
2323

24+
#define BUILTIN_STASH_LIST_USAGE \
25+
N_("git stash list [<log-options>]")
26+
#define BUILTIN_STASH_SHOW_USAGE \
27+
N_("git stash show [-u | --include-untracked | --only-untracked] [<diff-options>] [<stash>]")
28+
#define BUILTIN_STASH_DROP_USAGE \
29+
N_("git stash drop [-q | --quiet] [<stash>]")
30+
#define BUILTIN_STASH_POP_USAGE \
31+
N_("git stash pop [--index] [-q | --quiet] [<stash>]")
32+
#define BUILTIN_STASH_APPLY_USAGE \
33+
N_("git stash apply [--index] [-q | --quiet] [<stash>]")
34+
#define BUILTIN_STASH_BRANCH_USAGE \
35+
N_("git stash branch <branchname> [<stash>]")
36+
#define BUILTIN_STASH_STORE_USAGE \
37+
N_("git stash store [(-m | --message) <message>] [-q | --quiet] <commit>")
38+
#define BUILTIN_STASH_PUSH_USAGE \
39+
N_("git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n" \
40+
" [-u | --include-untracked] [-a | --all] [(-m | --message) <message>]\n" \
41+
" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n" \
42+
" [--] [<pathspec>...]]")
43+
#define BUILTIN_STASH_SAVE_USAGE \
44+
N_("git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n" \
45+
" [-u | --include-untracked] [-a | --all] [<message>]")
46+
#define BUILTIN_STASH_CREATE_USAGE \
47+
N_("git stash create [<message>]")
48+
#define BUILTIN_STASH_CLEAR_USAGE \
49+
"git stash clear"
50+
2451
static const char * const git_stash_usage[] = {
25-
N_("git stash list [<log-options>]"),
26-
N_("git stash show [<options>] [<stash>]"),
27-
N_("git stash drop [-q | --quiet] [<stash>]"),
28-
N_("git stash (pop | apply) [--index] [-q | --quiet] [<stash>]"),
29-
N_("git stash branch <branchname> [<stash>]"),
30-
"git stash clear",
31-
N_("git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n"
32-
" [-u | --include-untracked] [-a | --all] [(-m | --message) <message>]\n"
33-
" [--pathspec-from-file=<file> [--pathspec-file-nul]]\n"
34-
" [--] [<pathspec>...]]"),
35-
N_("git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]\n"
36-
" [-u | --include-untracked] [-a | --all] [<message>]"),
52+
BUILTIN_STASH_LIST_USAGE,
53+
BUILTIN_STASH_SHOW_USAGE,
54+
BUILTIN_STASH_DROP_USAGE,
55+
BUILTIN_STASH_POP_USAGE,
56+
BUILTIN_STASH_APPLY_USAGE,
57+
BUILTIN_STASH_BRANCH_USAGE,
58+
BUILTIN_STASH_PUSH_USAGE,
59+
BUILTIN_STASH_SAVE_USAGE,
60+
BUILTIN_STASH_CLEAR_USAGE,
61+
BUILTIN_STASH_CREATE_USAGE,
62+
BUILTIN_STASH_STORE_USAGE,
3763
NULL
3864
};
3965

4066
static const char * const git_stash_list_usage[] = {
41-
N_("git stash list [<options>]"),
67+
BUILTIN_STASH_LIST_USAGE,
4268
NULL
4369
};
4470

4571
static const char * const git_stash_show_usage[] = {
46-
N_("git stash show [<options>] [<stash>]"),
72+
BUILTIN_STASH_SHOW_USAGE,
4773
NULL
4874
};
4975

5076
static const char * const git_stash_drop_usage[] = {
51-
N_("git stash drop [-q | --quiet] [<stash>]"),
77+
BUILTIN_STASH_DROP_USAGE,
5278
NULL
5379
};
5480

5581
static const char * const git_stash_pop_usage[] = {
56-
N_("git stash pop [--index] [-q | --quiet] [<stash>]"),
82+
BUILTIN_STASH_POP_USAGE,
5783
NULL
5884
};
5985

6086
static const char * const git_stash_apply_usage[] = {
61-
N_("git stash apply [--index] [-q | --quiet] [<stash>]"),
87+
BUILTIN_STASH_APPLY_USAGE,
6288
NULL
6389
};
6490

6591
static const char * const git_stash_branch_usage[] = {
66-
N_("git stash branch <branchname> [<stash>]"),
92+
BUILTIN_STASH_BRANCH_USAGE,
6793
NULL
6894
};
6995

7096
static const char * const git_stash_clear_usage[] = {
71-
"git stash clear",
97+
BUILTIN_STASH_CLEAR_USAGE,
7298
NULL
7399
};
74100

75101
static const char * const git_stash_store_usage[] = {
76-
N_("git stash store [(-m | --message) <message>] [-q | --quiet] <commit>"),
102+
BUILTIN_STASH_STORE_USAGE,
77103
NULL
78104
};
79105

80106
static const char * const git_stash_push_usage[] = {
81-
N_("git stash [push [-p | --patch] [-k | --[no-]keep-index] [-q | --quiet]\n"
82-
" [-u | --include-untracked] [-a | --all] [(-m | --message) <message>]\n"
83-
" [--] [<pathspec>...]]"),
107+
BUILTIN_STASH_PUSH_USAGE,
84108
NULL
85109
};
86110

87111
static const char * const git_stash_save_usage[] = {
88-
N_("git stash save [-p | --patch] [-k | --[no-]keep-index] [-q | --quiet]\n"
89-
" [-u | --include-untracked] [-a | --all] [<message>]"),
112+
BUILTIN_STASH_SAVE_USAGE,
90113
NULL
91114
};
92115

0 commit comments

Comments
 (0)