git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Chrissy Wainwright <chrissy@sixfeetup.com>
Cc: Kyle Meyer <kyle@kyleam.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Stash does not save rename information
Date: Mon, 16 Dec 2019 14:25:54 -0500	[thread overview]
Message-ID: <20191216192554.GB2678964@coredump.intra.peff.net> (raw)
In-Reply-To: <EF4FE28C-1111-46C7-9EDE-24940E8A5727@sixfeetup.com>

On Mon, Dec 16, 2019 at 02:32:31PM +0000, Chrissy Wainwright wrote:

> Thank you, using --index does work! Now the trick is to actually
> remember to use it in this case, since it doesn't seem the change can
> be restored if you forget to use it the first time you pop/apply.

I think this is a spot where git-stash could be a little friendlier. If
you've stashed index changes and "git stash pop", then those index
changes are not applied but get thrown away, losing information.

It would be nicer if "stash pop" noticed that there are entries in the
stashed index that do not match HEAD or the stashed working tree, and
applied as requested but _didn't_ remove the stash (with a message that
you can get your index changes out with "--keep-index").

Maybe a good small project for somebody looking to get their feet wet
with contributing to Git (you, or anybody else reading this).

-Peff

      parent reply	other threads:[~2019-12-16 19:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 19:41 Stash does not save rename information Chrissy Wainwright
2019-12-14 23:00 ` Kyle Meyer
2019-12-14 23:05   ` Kyle Meyer
2019-12-16 14:32     ` Chrissy Wainwright
2019-12-16 18:42       ` Bryan Turner
2019-12-16 19:25       ` Jeff King [this message]

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

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

  git send-email \
    --in-reply-to=20191216192554.GB2678964@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=chrissy@sixfeetup.com \
    --cc=git@vger.kernel.org \
    --cc=kyle@kyleam.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.
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 NNTP newsgroup(s).