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

PATCH] Documentation: Tweak use case in "git stash save --keep-index"

From
EREric Raible <raible@gmail.com>
Date
Jul 8, 2008, 05:18 UTC
Message-ID
<279b37b20807072218o19dabd97y2c4edc62fb980ca4@mail.gmail.com>

The documentation suggests using "git stash apply" in the --keep-index workflow even though doing so will lead to clutter in the stash. And given that the changes are about to be committed anyway "git stash pop" is more sensible.

Additionally the text preceeding the example claims that it works for "two or more commits", but the example itself is really tailored for just two. Expanding it just a little makes it clear how the procedure generalizes to N commits.

Signed-off-by: Eric Raible <raible@gmail.com>
---
Note that this is relative to Junio's pu branch (v1.5.6.2-397-g20210bb)
 Documentation/git-stash.txt |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index df26901..bf241da 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -201,9 +201,10 @@ $ git add --patch foo
 $ git stash save --keep-index
 $ build && run tests
 $ git commit -m 'First part'
-$ git stash apply
+$ git stash pop
+... repeat above five steps until one commit remains ...
 $ build && run tests
-$ git commit -a -m 'Second part'
+$ git commit foo -m 'Remaining parts'
 ----------------------------------------------------------------

 SEE ALSO
-- 
1.5.6.1.1073.g489ff.dirty
Next: Junio C Hamano
Message 1 of 3 in “PATCH] Documentation: Tweak use case in "git stash save --keep-index"”
  1. Eric RaibleJul 8, 2008
  2. Junio C HamanoJul 8, 2008
  3. Eric RaibleJul 8, 2008

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.