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

Re: My stash wants to delete all my files

From
Jonathan del Strother <maillist@steelskies.com>
Date
Sep 25, 2007, 09:27 UTC
Message-ID
<DCBF8566-9B43-4EFA-A8B2-2EAB516C273F@steelskies.com>
In-Reply-To
<7vabrb8rin.fsf@gitster.siamese.dyndns.org>
On 25 Sep 2007, at 02:26, Junio C Hamano wrote:
Show 29 quoted lines
> Jonathan del Strother <maillist@steelskies.com> writes:
>
>> $ git stash list
>> stash@{0}: On master: --apply
>> stash@{1}: WIP on master: 09e3c30... Better handling of cell sizes in
>> the grid
>>
>> $ git stash show stash@{1}
>> ...
>> 19 files changed, 0 insertions(+), 3805 deletions(-)
>>
>> Hmm.  Looks like it's trying to delete all of my versioned files.
>> "git stash apply stash@{1}" confirms this.   Obviously that's not  
>> what
>> I tried to stash - my WIP when I stashed was a few additions, a  
>> couple
>> of new unversioned files, and moving a few lines of code from one  
>> file
>> to another.
>>
>> Any ideas what happened there?  I can't seem to reproduce the problem
>> in a test repository.
>
> ...
> Whenever anybody wonders where inadvertent reverting changes
> come from, two most likely reasons are incorrect push into the
> current branch's tip initiated from elsewhere, or incorrect
> fetch into the current branch's tip initiated from the
> repository.

I'm working on a single isolated repository, so haven't pushed, pulled, fetched, or anything.

> 	git ls-tree stash@{1}
>        git rev-parse stash@{1}^1
>        git diff stash@{1}^1 stash@{1}^2
>

ls-tree is empty. rev-parse confirms I was on the right revision when I stashed, and the diff shows everything being deleted.

> Does the third command show you what you thought you have
> told "git add" to put in the index just before you made the
> stash?

I don't think I git-added anything - just made changes to the working copy. (It *does* stash those, right??)

I'm at a loss to explain what happened here...
Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 6 in “My stash wants to delete all my files”
  1. Jonathan del StrotherSep 24, 2007
  2. Junio C HamanoSep 25, 2007
  3. Jonathan del StrotherSep 25, 2007
  4. Johannes SchindelinSep 25, 2007
  5. Jonathan del StrotherSep 25, 2007
  6. Johannes SchindelinSep 25, 2007

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.