Re: Viewing untracked+stashed files in git stash show
- From
Jeff King <peff@peff.net>
- Date
- Mar 17, 2017, 13:51 UTC
- Message-ID
- <20170317135144.scnbtyug2cqbg77p@sigill.intra.peff.net>
- In-Reply-To
- <CAOtcWM1jExsj_L4HRm194F57bt9LPuf8fFSpyuGWiPG7U_4v8A@mail.gmail.com>
On Fri, Mar 17, 2017 at 09:50:29AM +0000, Okash Khawaja wrote:
Show 15 quoted lines
> Hi,
>
> On Fri, Mar 17, 2017 at 8:20 AM, <stefan.naewe@atlas-elektronik.com> wrote:
> > Am 16.03.2017 um 17:34 schrieb Okash Khawaja:
> >> Hi,
> >>
> >> If you have some untracked files and your run `git stash -u`. Then
> >> `git stash show` doesn't show the untracked files. Is there a flag
> >> that can be passed to git stash show to report untracked files?
> >
> > Not for 'git stash' but you can use 'git show stash@{0}^3
>
> Okay that's fine as long as you know. But the first thing that comes
> to your mind is that you've lost those untracked files. Is there a
> reason why git stash show doesn't show those files?No, I don't think there is a good reason. The "untracked" option was added to git-stash much later, and nobody considered how it interacted with "stash show".
Changes from the index have the same problem. Probably "stash show" should have options "--index" and "--untracked" to show:
# index git diff $stash^1 $stash^2
# untracked git diff $stash^1 $stash^3
Possibly it should even show those by default when they are non-empty.
-Peff