{"thread":{"id":"35103","subject":"[BUG] git stash doesn't use --index as default","startedAt":"2013-10-11T04:57:10Z","lastAt":"2013-10-11T04:57:10Z","messageCount":1,"participants":["James"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"228724","messageId":"1381467430.4130.38.camel@freed.purpleidea.com","threadId":"35103","inReplyTo":null,"subject":"[BUG] git stash doesn't use --index as default","fromName":"James","fromEmail":"purpleidea@gmail.com","sentAt":"2013-10-11T04:57:10Z","receivedAt":"2013-10-11T04:57:10Z","isPatch":false,"sender":{"key":"purpleidea@gmail.com","avatar":"https://gravatar.com/avatar/161941d0314aee3803e1012aa5dedb2403ed9dcd00ec769bce81435493abe18d?d=mp&s=160"},"body":"As discussed on #git irc:\n\ngit init\nvim file1\nvim file2\ngit add file1\ngit add file2\ngit commit -m 'foo'\nvim file1\nvim file2\nvim file3\nvim file4\ngit add -p file1 # add part of file1, use 'e' to change code too.\ngit add file2 # add all of file2\ngit add file3\ngit stash # do a stash\n\nhack hack hack\ngit add, commit.\n\ngit stash apply\n# whoa! all my changes to index are gone!\n\nfail fail... :( sad sad.\n\ngit reset HEAD\ngit stash apply --index\n\n# phew, there are my changes.\ngit stash apply --index # the --index should be the default!\n\n# WORSE:\nif you:\ngit stash pop\nthen DATA LOSS. (because you forgot the --index)\n\nMade this super clear. #git agrees this is a bug, if only a UI default\nbug. Pretty serious though.\n\nCheers,\n\nJames\n\nPS: please cc me on replies, as I'm not subscribed to list.\n\n"}]}