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

From: Junio C Hamano <[email-masked]>
Date: Wed, 21 Feb 2024 12:09:45 -0800

Ricardo C <[email-masked]> writes:

> 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.