git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Surprise at git stash pop

From
PFPéter András Felvégi <petschy@gmail.com>
Date
Jul 26, 2011, 09:26 UTC
Message-ID
<CAG3eYYR3PnGYJohAwTfDD24QKqgsaoW_i7v5FS0vqyXS6udF_w@mail.gmail.com>
In-Reply-To
<5fuhYLPOf07EnF5c5gyqAvbP3UZl6m72FicTS5tZnr3K8vTH5UoLkA@cipher.nrlssc.navy.mil>
Hello,
2011/7/25 Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil>:
Show 8 quoted lines
> On 07/25/2011 10:45 AM, Péter András Felvégi wrote:
>> Hello,
>>
>> 'git stash pop' erased my local modifications, but not all of them.
>
> Hi,
>
> I cannot reproduce this.  What version of git are you using?
git 1.7.5.4 on Debian Wheezy AMD64
>
> Can you produce a test case?  This could be a test repo that
> you can share or a sequence of commands to produce such a
> repo like:

Not likely, but I will try. My repo started as CVS, then converted to SVN, and about a year ago, I switched to GIT. It has 5+ years of history, 9k+ commits, multiple branches, merges.

What I checked so far is that:
- the stash on 089709b I was popping is of 2011.03.01
- since then, a lot of commits and fast forward merges were done on the branch
- there were some rebase -i's to squash commits together, but I was
careful not to alter commits already pushed to the central repo
Since yesterday, I found out that my branch diverged:

# Your branch and 'origin/20110207-oracle' have diverged, # and have 11 and 9 different commit(s) each, respectively.

I don't know how can this happen, because I only pull/push to/from the central repo, and noone else is using it.

When I pulled, there were merge conflicts, earlier versions of the files showing up. There were 3 files, SQLQueryCache cpp/hpp and AdsPlugin.cpp. I resolved the commits by keeping the HEAD versions.

What is interesting is that the stash item that caused the problems is still there, despite that it was popped:

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

$ git stash show
 build-configs.def |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

I made a copy of my local repo, and the central one, too, but I don't really know what to do now. The state of the repo before the pop is lost, unfortunately.

Is there some option for git to log its actions, so that in cases like this one could check on the inner workings?

Regards, Peter
Previous: Brandon Casey
Message 3 of 3 in “Surprise at git stash pop”
  1. Péter András FelvégiJul 25, 2011
  2. Brandon CaseyJul 25, 2011
  3. Péter András FelvégiJul 26, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.