From: D. Ben Knoble Date: Wed, 24 Sep 2025 20:40:48 GMT Subject: Re: [PATCH v3 4/4] stash: honor stash.index in apply, pop modes Message-ID: In-Reply-To: On Mon, Sep 22, 2025 at 10:11 AM Phillip Wood wrote: > > Hi Ben > > On 22/09/2025 02:39, D. Ben Knoble wrote: > > With stash.index=true, git-stash(1) command now tries to reinstate the > > index by default in the "apply" and "pop" modes. Not doing so creates a > > common trap [1], [2]: "git stash apply" is not the reverse of "git stash > > push" because carefully staged indices are lost and have to be manually > > recreated. OTOH, this mode is not always desirable and may create more > > conflicts when applying stashes. As usual, "--no-index" will disable > > this behavior if you set "stash.index". > > Thanks for updating the tests, they look good. As I said before I don't > have a strong opinion about this change but I certainly don't object to > it. I think this change will also affect the behavior of "git > merge/pull/rebase --autostash" which we should maybe call out in the > commit message. I don't think that change in behavior is a problem as it > is probably what the user would expect when they set this config. Agreed, I hadn't considered that here. Should we also update the docs, do you think?