git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: randall.s.becker@rogers.com
Cc: git@vger.kernel.org
Subject: Re: [BUG} stash show does not show untracked files stashed (reposted)
Date: Wed, 4 Sep 2019 03:29:27 -0400	[thread overview]
Message-ID: <20190904072926.GA18470@sigill.intra.peff.net> (raw)
In-Reply-To: <002901d55e8f$e4a4af70$adee0e50$@rogers.com>

On Thu, Aug 29, 2019 at 01:33:36PM -0400, randall.s.becker@rogers.com wrote:

> I don't know whether this is new behaviour following changes to stash, but
> here goes.
> 
> Suppose I have files a,b,c,d modified, but only file d is in the index.
> After stash push  (or save) --include-untracked, stash show only displays
> file d. A subsequent pop will restore files a,b,c,d. So functionally push
> and pop are fine, but stash show appears to ignores files in the stash. The
> git log below shows a previous commit (dce2e3e) to the WIP stash (ab0834c)
> that does contain the untracked files, and git diff is happy to show the
> contents when using the ref directly. It is just counterintuitive for stash
> show not to display all entries previously pushed. I would have expected
> symmetry. This is not new.

Right, this is expected but unfortunate. The same problem occurs with
stashed changes to the index. The fundamental issue is that a stash is
not representing a single diff, but rather up to three diffs:

  - changes to the working tree

  - changes to the index

  - a set of untracked files

each of which is stored as a separate commit.

This has been discussed off and on. A while ago I suggested a possible
output format that shows all three:

  https://public-inbox.org/git/20170317141417.g2oenl67k74nlqrq@sigill.intra.peff.net/

The patch there is useless now, as stash has been rewritten in C (though
that probably means it would be possible to make it less hacky). The
main obstacle IMHO is whether we're comfortable changing the output away
from a single diff. I could imagine somebody scripting around stash,
though if the output remained the same for stashes without index changes
or untracked files, that makes problems less likely.

-Peff

  reply	other threads:[~2019-09-04  7:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 17:33 [BUG} stash show does not show untracked files stashed (reposted) randall.s.becker
2019-09-04  7:29 ` Jeff King [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-09-02 13:01 Giuseppe Crinò
2019-09-02 15:56 ` Philip Oakley
2019-09-02 18:15   ` randall.s.becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190904072926.GA18470@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=randall.s.becker@rogers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).