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

Re: [PATCH] builtin/stash: configs keepIndex, includeUntracked

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 21, 2024, 20:09 UTC
Message-ID
<xmqq4je1o9yu.fsf@gitster.g>
In-Reply-To
<b84e77a1-93e4-4de0-a0cd-4d76a5691a9b@gmail.com>
Ricardo C <rpc01234@gmail.com> writes:
Show 6 quoted lines
> Permanently enabling keepIndex is mainly intended for people that like
> to stash their unstaged changes before committing (e.g., for testing
> them independently of other changes). The main issue with what you
> recommend is that, if they forget to use `-k`, then the entire state
> of the index is lost, which is especially problematic if the changes
> were interactively staged.

Doesn't "git stash pop --index" meant to recover from such a mistake, though? If you stash, because your "git commit" notices there is no change after you did "git stash" without "-k", your recovery to "pop --index" would apply the changes to the index and to the working tree on top of exactly the same commit, so there is no risk of losing any changes by doing so, right? IOW, such a pop will always round-trip.

Previous: Ricardo CNext: Ricardo C
Message 7 of 16 in “builtin/stash: configs keepIndex, includeUntracked”
  1. builtin/stash: configs keepIndex, includeUntrackedMithicSpirit, Feb 18, 2024
  2. Phillip WoodFeb 18, 2024
  3. Ricardo CFeb 18, 2024
  4. Phillip WoodFeb 20, 2024
  5. Junio C HamanoFeb 20, 2024
  6. Ricardo CFeb 21, 2024
  7. Junio C HamanoFeb 21, 2024
  8. Ricardo CFeb 21, 2024
  9. Junio C HamanoFeb 21, 2024
  10. Junio C HamanoFeb 20, 2024
  11. Ricardo CFeb 20, 2024
  12. Junio C HamanoFeb 20, 2024
  13. Ricardo CFeb 20, 2024
  14. Kristoffer HaugsbakkFeb 20, 2024
  15. Jean-Noël AvilaFeb 19, 2024
  16. Ricardo CFeb 19, 2024

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.