git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: James <purpleidea@gmail.com>
To: git@vger.kernel.org
Subject: [BUG] git stash doesn't use --index as default
Date: Fri, 11 Oct 2013 00:57:10 -0400	[thread overview]
Message-ID: <1381467430.4130.38.camel@freed.purpleidea.com> (raw)

[-- 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 --]

                 reply	other threads:[~2013-10-11  4:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381467430.4130.38.camel@freed.purpleidea.com \
    --to=purpleidea@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).