git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Michael Brade <brade@kde.org>
To: git@vger.kernel.org
Subject: git stash save -u deletes ignored files without stashing them
Date: Sat, 12 Dec 2015 23:51:09 -0800	[thread overview]
Message-ID: <566D236D.5090904@kde.org> (raw)

Hi,

and it does so if .gitignore has not been committed yet. This is with
git version 2.6.3. To reproduce:

mkdir test
cd test
git init

echo "test" > test
echo "something.txt" > .gitignore

git add test .gitignore
git commit -a -m "init"

mkdir node_modules
echo "something" > node_modules/file.txt
echo "node_modules" >> .gitignore

git stash save -u

Now node_modules will be deleted even though it was ignored at the time
of the "git stash save -u". Apparently .gitignore is reverted first,
then the cleanup is done taking the new state of .gitignore into account
where node_modules is now untracked and not ignored anymore, thus
deleting it.

I think this should be considered a bug that can cause data loss, even
if only in rare cases.

thanks,
  Michael

PS: I'm not subscribed.

             reply	other threads:[~2015-12-13  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13  7:51 Michael Brade [this message]
2016-02-04  7:40 ` git stash save -u deletes ignored files without stashing them Kevin Locke

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=566D236D.5090904@kde.org \
    --to=brade@kde.org \
    --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).