git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/2] Documentation: mention 'git stash pop --index' option explicitly

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Jun 8, 2009, 22:57 UTC
Message-ID
<d07a10275620808bc378340cc8450d3e8de8cf7e.1244501726.git.szeder@ira.uka.de>
In-Reply-To
<20090608214243.GK13773@neumann>

'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>
---
 Documentation/git-stash.txt |   16 ++++++++--------
 git-stash.sh                |    4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index 1cc24cc..a42d4c8 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -9,8 +9,8 @@ SYNOPSIS
 --------
 [verse]
 'git stash' list [<options>]
-'git stash' (show | drop | pop ) [<stash>]
-'git stash' apply [--index] [<stash>]
+'git stash' ( show | drop ) [<stash>]
+'git stash' ( pop | apply ) [--index] [<stash>]
 'git stash' branch <branchname> [<stash>]
 'git stash' [save [--keep-index] [<message>]]
 'git stash' clear
@@ -86,16 +86,16 @@ Applying the state can fail with conflicts; in this case, it is not
 removed from the stash list. You need to resolve the conflicts by hand
 and call `git stash drop` manually afterwards.
 +
-When no `<stash>` is given, `stash@\{0}` is assumed. See also `apply`.
-
-apply [--index] [<stash>]::
-
-	Like `pop`, but do not remove the state from the stash list.
-+
 If the `--index` option is used, then tries to reinstate not only the working
 tree's changes, but also the index's ones. However, this can fail, when you
 have conflicts (which are stored in the index, where you therefore can no
 longer apply the changes as they were originally).
++
+When no `<stash>` is given, `stash@\{0}` is assumed.
+
+apply [--index] [<stash>]::
+
+	Like `pop`, but do not remove the state from the stash list.
 
 branch <branchname> [<stash>]::
 
diff --git a/git-stash.sh b/git-stash.sh
index b9ace99..e6a5867 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -3,8 +3,8 @@
 
 dashless=$(basename "$0" | sed -e 's/-/ /')
 USAGE="list [<options>]
-   or: $dashless (show | drop | pop ) [<stash>]
-   or: $dashless apply [--index] [<stash>]
+   or: $dashless ( show | drop ) [<stash>]
+   or: $dashless ( pop | apply ) [--index] [<stash>]
    or: $dashless branch <branchname> [<stash>]
    or: $dashless [save [--keep-index] [<message>]]
    or: $dashless clear"
-- 
1.6.3.2.252.g5b6b0
Previous: SZEDER GáborNext: SZEDER Gábor
Message 7 of 9 in “Documentation: mention 'git stash pop --index' option explicitly”
  1. 1/2 Documentation: mention 'git stash pop --index' option explicitlySZEDER Gábor, Jun 8, 2009
  2. 2/2 bash: add support for 'git stash pop --index' optionSZEDER Gábor, Jun 8, 2009
  3. Brandon CaseyJun 8, 2009
  4. Brandon CaseyJun 8, 2009
  5. Junio C HamanoJun 8, 2009
  6. SZEDER GáborJun 8, 2009
  7. 1/2 Documentation: mention 'git stash pop --index' option explicitlySZEDER Gábor, Jun 8, 2009
  8. 2/2 bash: add support for 'git stash pop --index' optionSZEDER Gábor, Jun 8, 2009
  9. Junio C HamanoJun 9, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.