git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] git stash doesn't use --index as default
@ 2013-10-11  4:57 James
  0 siblings, 0 replies; only message in thread
From: James @ 2013-10-11  4:57 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

As discussed on #git irc:

git init
vim file1
vim file2
git add file1
git add file2
git commit -m 'foo'
vim file1
vim file2
vim file3
vim file4
git add -p file1 # add part of file1, use 'e' to change code too.
git add file2 # add all of file2
git add file3
git stash # do a stash

hack hack hack
git add, commit.

git stash apply
# whoa! all my changes to index are gone!

fail fail... :( sad sad.

git reset HEAD
git stash apply --index

# phew, there are my changes.
git stash apply --index # the --index should be the default!

# WORSE:
if you:
git stash pop
then DATA LOSS. (because you forgot the --index)

Made this super clear. #git agrees this is a bug, if only a UI default
bug. Pretty serious though.

Cheers,

James

PS: please cc me on replies, as I'm not subscribed to list.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-11  4:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11  4:57 [BUG] git stash doesn't use --index as default James

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).