From: Johannes Sixt <j.sixt@viscovery.net>
To: Nikolay Frantsev <nikolay@frantsev.ru>
Cc: git@vger.kernel.org
Subject: Re: [BUG] Bug in git stash
Date: Mon, 14 Jan 2013 12:45:39 +0100 [thread overview]
Message-ID: <50F3EFE3.9020100@viscovery.net> (raw)
In-Reply-To: <CAOJsraHfKRoK1G8tA2ROUH6qt-q0kG6WesZr5enOeeqFF_AC=w@mail.gmail.com>
Am 1/14/2013 10:18, schrieb Nikolay Frantsev:
> nikolay@localhost:~/Desktop/git-stash_bug/bug$ git status
> # On branch master
> # Changes to be committed:
> # (use "git reset HEAD <file>..." to unstage)
> #
> # new file: 3
> #
> # Changes not staged for commit:
> # (use "git add <file>..." to update what will be committed)
> # (use "git checkout -- <file>..." to discard changes in working directory)
> #
> # modified: 1
> # modified: 2
> #
> nikolay@localhost:~/Desktop/git-stash_bug/bug$ git stash save --keep-index one
> Saved working directory and index state On master: one
> HEAD is now at 7e495f9 files added
...
> nikolay@localhost:~/Desktop/git-stash_bug/bug$ git stash pop stash@{1}
> # On branch master
> # Changes to be committed:
> # (use "git reset HEAD <file>..." to unstage)
> #
> # new file: 3
> #
> # Changes not staged for commit:
> # (use "git add <file>..." to update what will be committed)
> # (use "git checkout -- <file>..." to discard changes in working directory)
> #
> # modified: 1
> # modified: 2
> #
> Dropped stash@{1} (7926ab7285753c179a368a3a7e8ebfb0f39d0437)
>
> Why there a new empty file named 3?
It is by design. --keep-index only achieves that your staged changes are
not reverted, but nevertheless all changes are stashed away. Therefore,
when you later apply the stash, you also get back the modified index.
-- Hannes
prev parent reply other threads:[~2013-01-14 11:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 9:18 [BUG] Bug in git stash Nikolay Frantsev
2013-01-14 11:45 ` Johannes Sixt [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F3EFE3.9020100@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=git@vger.kernel.org \
--cc=nikolay@frantsev.ru \
/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.
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).