# Fwd: `git stash pop -q` is deleting files.

5 messages from 2019-12-16 to 2019-12-17. Participants: Marce Romagnoli, Junio C Hamano, Thomas Gummerer.
Thread: https://gitlist.dev/t/52466

## Marce Romagnoli, 2019-12-16 13:19

Subject: Fwd: `git stash pop -q` is deleting files.
Message-ID: <CA+0NiBEifgam1xVJw7F=mO_DtLgfqK9g7eHJMK5dt3yc1JpaAQ@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B0NiBEifgam1xVJw7F%3DmO_DtLgfqK9g7eHJMK5dt3yc1JpaAQ%40mail.gmail.com
In-Reply-To: <CA+0NiBFU46YRBFEbngK+Rc0e4uE_nSqQkYak9a-_UoTaCCb1Jg@mail.gmail.com>

```
Hi list,
this is my first time reporting (what I think is) a bug in git.

WHAT
`git stash pop -q` untracks stashed files and others.

WHICH VERSION
v2.24.1

HOW-TO REPRODUCE
- Create an empty repository
- Create 2 files, track them and commit.
- Change one of the files
- `git stash`
- `git stash pop -q`
-- Expected: The touched file is back in the index
-- Returned: All the files are no longer tracked.

We use this command on a pre-commit hook and we were scared for the
first time we realized all our files were deleted, anyway, it was easy
to go back.

Thanks for your time in advance.

Best,



Marcelo Romagnoli

```

## Junio C Hamano, 2019-12-16 19:13

Subject: Re: Fwd: `git stash pop -q` is deleting files.
Message-ID: <xmqqd0cojd7r.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqd0cojd7r.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <CA+0NiBEifgam1xVJw7F=mO_DtLgfqK9g7eHJMK5dt3yc1JpaAQ@mail.gmail.com>

```
I think this has already been fixed with

http://lore.kernel.org/git/20191113150136.GB3047@cat

at the tip of 'master' a few weeks ago.


```

## Marce Romagnoli, 2019-12-17 13:32

Subject: Re: Fwd: `git stash pop -q` is deleting files.
Message-ID: <CA+0NiBGQHK_bVdH11zRErxNTjvyU-SqJYj=CHZy3afm47+reYA@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B0NiBGQHK_bVdH11zRErxNTjvyU-SqJYj%3DCHZy3afm47%2BreYA%40mail.gmail.com
In-Reply-To: <xmqqd0cojd7r.fsf@gitster-ct.c.googlers.com>

```
But it seems is still happening to me in 2.24.1 -latest-


Marcelo Romagnoli

El lun., 16 dic. 2019 a las 20:13, Junio C Hamano
(<gitster@pobox.com>) escribió:
>
> I think this has already been fixed with
>
> http://lore.kernel.org/git/20191113150136.GB3047@cat
>
> at the tip of 'master' a few weeks ago.
>

```

## Thomas Gummerer, 2019-12-17 13:59

Subject: Re: Fwd: `git stash pop -q` is deleting files.
Message-ID: <20191217135945.GA5103@cat>
URL: https://gitlist.dev/e/20191217135945.GA5103%40cat
In-Reply-To: <CA+0NiBGQHK_bVdH11zRErxNTjvyU-SqJYj=CHZy3afm47+reYA@mail.gmail.com>

```
[please don't top-post on this list]

On 12/17, Marce Romagnoli wrote:
> But it seems is still happening to me in 2.24.1 -latest-

It being in master doesn't mean it has made it into a release yet,
though it means it will in the future.  So you have a couple of
options in the meantime:

  - Compile Git yourself from the 'master' branch
  - Go back to an older version of git.  v2.23 didn't have this
    problem, but it had a different issue that I was trying to fix in
    34933d0eff ("stash: make sure to write refreshed cache",
    2019-09-11), but where this bug was introduced.
  - set the stash.useBuiltin configuration option to false, which will
    make you use the legacy stash written as a shell script.  This
    also shouldn't have this bug.

> El lun., 16 dic. 2019 a las 20:13, Junio C Hamano
> (<gitster@pobox.com>) escribió:
> >
> > I think this has already been fixed with
> >
> > http://lore.kernel.org/git/20191113150136.GB3047@cat
> >
> > at the tip of 'master' a few weeks ago.
> >

```

## Marce Romagnoli, 2019-12-17 16:10

Subject: Re: Fwd: `git stash pop -q` is deleting files.
Message-ID: <CA+0NiBHFcVZ0RpDB6kffCA5fzdfhcGwH7k=4q15kbXeF5J7UPQ@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2B0NiBHFcVZ0RpDB6kffCA5fzdfhcGwH7k%3D4q15kbXeF5J7UPQ%40mail.gmail.com
In-Reply-To: <20191217135945.GA5103@cat>

```
Oh ok, thanks to everybody for your time!

Marcelo Romagnoli

El mar., 17 dic. 2019 a las 14:59, Thomas Gummerer
(<t.gummerer@gmail.com>) escribió:
>
> [please don't top-post on this list]
>
> On 12/17, Marce Romagnoli wrote:
> > But it seems is still happening to me in 2.24.1 -latest-
>
> It being in master doesn't mean it has made it into a release yet,
> though it means it will in the future.  So you have a couple of
> options in the meantime:
>
>   - Compile Git yourself from the 'master' branch
>   - Go back to an older version of git.  v2.23 didn't have this
>     problem, but it had a different issue that I was trying to fix in
>     34933d0eff ("stash: make sure to write refreshed cache",
>     2019-09-11), but where this bug was introduced.
>   - set the stash.useBuiltin configuration option to false, which will
>     make you use the legacy stash written as a shell script.  This
>     also shouldn't have this bug.
>
> > El lun., 16 dic. 2019 a las 20:13, Junio C Hamano
> > (<gitster@pobox.com>) escribió:
> > >
> > > I think this has already been fixed with
> > >
> > > http://lore.kernel.org/git/20191113150136.GB3047@cat
> > >
> > > at the tip of 'master' a few weeks ago.
> > >

```
