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

Re: Stash does not save rename information

From
Jeff King <peff@peff.net>
Date
Dec 16, 2019, 19:25 UTC
Message-ID
<20191216192554.GB2678964@coredump.intra.peff.net>
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
Previous: Bryan Turner
Message 6 of 6 in “Stash does not save rename information”
  1. Chrissy WainwrightDec 14, 2019
  2. Kyle MeyerDec 14, 2019
  3. Kyle MeyerDec 14, 2019
  4. Chrissy WainwrightDec 16, 2019
  5. Bryan TurnerDec 16, 2019
  6. Jeff KingDec 16, 2019

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.