Skip to content

Commit f39d6ee

Browse files
szedergitster
authored andcommitted
Documentation: mention 'git stash pop --index' option explicitly
'git stash pop' supports the '--index' option since its initial implementation (bd56ff5, git-stash: add new 'pop' subcommand, 2008-02-22), but its documentation does not mention it explicitly. Moreover, both the usage shown by 'git stash -h' and the synopsis section in the man page imply that 'git stash pop' does not have an '--index' option. First, this patch corrects the usage and the synopsis section. Second, the patch moves the description of the '--index' option to the 'git stash pop' section in the documentation, and refers to it from the 'git stash apply' section. This way it follows the intentions of commit d183663 (Documentation: teach stash/pop workflow instead of stash/apply, 2009-05-28), as all 'git stash pop'-related documentation will be in one place without references to 'git stash apply'. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4e2715f commit f39d6ee

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Documentation/git-stash.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ SYNOPSIS
99
--------
1010
[verse]
1111
'git stash' list [<options>]
12-
'git stash' (show | drop | pop ) [<stash>]
13-
'git stash' apply [--index] [<stash>]
12+
'git stash' ( show | drop ) [<stash>]
13+
'git stash' ( pop | apply ) [--index] [<stash>]
1414
'git stash' branch <branchname> [<stash>]
1515
'git stash' [save [--keep-index] [<message>]]
1616
'git stash' clear
@@ -86,16 +86,16 @@ Applying the state can fail with conflicts; in this case, it is not
8686
removed from the stash list. You need to resolve the conflicts by hand
8787
and call `git stash drop` manually afterwards.
8888
+
89-
When no `<stash>` is given, `stash@\{0}` is assumed. See also `apply`.
90-
91-
apply [--index] [<stash>]::
92-
93-
Like `pop`, but do not remove the state from the stash list.
94-
+
9589
If the `--index` option is used, then tries to reinstate not only the working
9690
tree's changes, but also the index's ones. However, this can fail, when you
9791
have conflicts (which are stored in the index, where you therefore can no
9892
longer apply the changes as they were originally).
93+
+
94+
When no `<stash>` is given, `stash@\{0}` is assumed.
95+
96+
apply [--index] [<stash>]::
97+
98+
Like `pop`, but do not remove the state from the stash list.
9999

100100
branch <branchname> [<stash>]::
101101

git-stash.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
dashless=$(basename "$0" | sed -e 's/-/ /')
55
USAGE="list [<options>]
6-
or: $dashless (show | drop | pop ) [<stash>]
7-
or: $dashless apply [--index] [<stash>]
6+
or: $dashless ( show | drop ) [<stash>]
7+
or: $dashless ( pop | apply ) [--index] [<stash>]
88
or: $dashless branch <branchname> [<stash>]
99
or: $dashless [save [--keep-index] [<message>]]
1010
or: $dashless clear"

0 commit comments

Comments
 (0)