Re: [PATCH v3 4/4] stash: honor stash.index in apply, pop modes
- From
D. Ben Knoble <ben.knoble+github@gmail.com>
- Date
- Sep 24, 2025, 20:40 UTC
- Message-ID
- <CALnO6CA9z39rgGd673p-ZMzMOBM_G37YPOs4ysNtPHGGCDVM-A@mail.gmail.com>
- In-Reply-To
- <d7721018-3b2f-4764-b33d-4fc6bdc034a1@gmail.com>
On Mon, Sep 22, 2025 at 10:11 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 18 quoted lines
> > 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?