@matheusbsbs / matheus-bagliano / commits / f39d6ee2aa
Fork 0

Documentation: mention 'git stash pop --index' option explicitly

'git stash pop' supports the '--index' option since its initial implementation (bd56ff54, 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 d1836637 (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 <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

SZEDER Gábor committed Jun 9, 2009 at 00:57 UTC f39d6ee2aad735641dce90f7e021e6b6862963c6
2 files changed +10 -10
Documentation/git-stash.txt
+8 -8
@@ -9,8 +9,8 @@ SYNOPSIS
9 --------
10 [verse]
11 '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>]
14 'git stash' branch <branchname> [<stash>]
15 'git stash' [save [--keep-index] [<message>]]
16 'git stash' clear
@@ -86,16 +86,16 @@ Applying the state can fail with conflicts; in this case, it is not
86 removed from the stash list. You need to resolve the conflicts by hand
87 and call `git stash drop` manually afterwards.
88 +
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 -+
89 If the `--index` option is used, then tries to reinstate not only the working
90 tree's changes, but also the index's ones. However, this can fail, when you
91 have conflicts (which are stored in the index, where you therefore can no
92 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.
99
100 branch <branchname> [<stash>]::
101
git-stash.sh
+2 -2
@@ -3,8 +3,8 @@
3
4 dashless=$(basename "$0" | sed -e 's/-/ /')
5 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>]
8 or: $dashless branch <branchname> [<stash>]
9 or: $dashless [save [--keep-index] [<message>]]
10 or: $dashless clear"