From: Junio C Hamano Date: Thu, 19 Mar 2026 16:48:47 GMT Subject: Re: [PATCH] checkout: add --autostash option for branch switching Message-ID: In-Reply-To: <20260319082514.49717-1-haraldnordgren@gmail.com> Harald Nordgren writes: > Hi Junio and Jeff! > > Did you get a chance to look at the latest changes? > > The scope of this grew a lot from my original idea of auto-stashing, so I'm > not 100% convinced that changing '-m' is necessary here. My fear is to > break something, especially since 'checkout -m' is a feature I never used > before touching it here, so I don't have a good sense of how it should > work. FWIW, I very much like what I see in $ git checkout hn/git-checkout-m-with-stash && git diff @{1} output. It is great that we do not have to do any dry-run, because the "real" run safely aborts, we can do the "stash && merge && unstash" dance as a fallback instead. All the credit goes to Phillip and you for the idea and the execution of this. I do use "checkout -m" a few times a week, but I do not do anything complex with submodules or run the command with unrelated local modifications, so there may be changes in behaviour I haven't seen in corner cases that I do not exercise.