git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unexpected behaviour with git stash save --keep-index?
@ 2008-09-01 23:14 Jonas Flodén
  2008-09-02  1:28 ` SZEDER Gábor
  2008-09-02  7:45 ` Karl Hasselström
  0 siblings, 2 replies; 6+ messages in thread
From: Jonas Flodén @ 2008-09-01 23:14 UTC (permalink / raw)
  To: git

Hello all,

while I was using StGit for the first time and used git stash to split
the changes into different patches I noticed that git stash save -- 
keep-index
will stash also the changes that are already in the index. This was  
unexpected
atleast to me but maybe someone can explain why it's correct.

The following sequence should illustrate the problem. Notice how both  
the
b and c are popped from the stash.

git init
echo a > test.txt
git add test.txt
git commit -m "a"
echo b >> test.txt
git add test.txt
echo c >> test.txt
git stash save --keep-index
git commit -m "b"
git checkout -b new_branch HEAD^
git stash pop
git diff

Also maybe someone could someone recommend a way to split an unclean  
working dir
into several patches/commits?

With regards

Jonas

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-02  7:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-01 23:14 Unexpected behaviour with git stash save --keep-index? Jonas Flodén
2008-09-02  1:28 ` SZEDER Gábor
2008-09-02  1:35   ` [PATCH] Documentation: fix disappeared lines in 'git stash' manpage SZEDER Gábor
2008-09-02  1:45     ` [PATCH] Documentation: minor cleanup in a use case in 'git stash' manual SZEDER Gábor
2008-09-02  6:20   ` Unexpected behaviour with git stash save --keep-index? Jonas Flodén
2008-09-02  7:45 ` Karl Hasselström

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).