git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Surprise at git stash pop
@ 2011-07-25 15:45 Péter András Felvégi
  2011-07-25 17:55 ` Brandon Casey
  0 siblings, 1 reply; 3+ messages in thread
From: Péter András Felvégi @ 2011-07-25 15:45 UTC (permalink / raw)
  To: git

Hello,

'git stash pop' erased my local modifications, but not all of them.
Here is the dump of my terminal window with comments:

1) 1 item in the stash:

petschy@stormbringer:~/...$ git stash list
stash@{0}: WIP on 20110207-oracle: 089709b Merge branch
'20110207-oracle' of ssh:.... into 20110207-oracle

2) the status of the working tree

petschy@stormbringer:~/...$ git status
# On branch 20110207-oracle
# Your branch is ahead of 'origin/20110207-oracle' by 2 commits.
#
# 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:   SQLQueryCache.cpp
#    modified:   SQLQueryCache.hpp
#    modified:   ../../server/plugins-src/ads/AdsPlugin.cpp
#    modified:   ../../server/plugins-src/ads/AdsPlugin.hpp

3) querying the details of the stashed item

petschy@stormbringer:~/...$ git stash show stash@{0}
 build-configs.def |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

4) popping it, naively

petschy@stormbringer:~/...$ git stash pop
Auto-merging build-configs.def
CONFLICT (content): Merge conflict in build-configs.def

5) surprise, surprise!

petschy@stormbringer:~/...$ git status
# On branch 20110207-oracle
# Your branch is ahead of 'origin/20110207-oracle' by 2 commits.
#
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#    both modified:      ../../build-configs.def
#
# 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:  SQLQueryCache.cpp

ALL of the local modifications to SQLQueryCache.hpp, AdsPlugin.cpp/hpp
simply disappeared! Is this the expected behaviour? I don't think so.
Since the stash contained only one file, which had nothing to do with
the pending modifications, I thought it's safe to pop. And even if the
local modifications and the stashed files overlap, I'd expect a
warning, at least. Half day's work gone. And if this is business as
usual, why not all my local modifications were wiped?

Regards, Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-26  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-25 15:45 Surprise at git stash pop Péter András Felvégi
2011-07-25 17:55 ` Brandon Casey
2011-07-26  9:26   ` Péter András Felvégi

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).