Re: [PATCH] checkout: add --autostash option for branch switching
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- Mar 13, 2026, 09:22 UTC
- Message-ID
- <20260313092258.30682-1-haraldnordgren@gmail.com>
- In-Reply-To
- <xmqqjyvgesjx.fsf@gitster.g>
Show 9 quoted lines
> With this, shouldn't "-m" become a synonym for "--autostash"? > For users of "checkout -m", this is a strictly improved version of > the same feature, it seems. > > Also, "stash" is merely an implementation detail of how we make the > merge safer, so from end-user's point of view, this feature is more > like "switch to the other branch, while merging the local changes > there", so calling it "--merge" or something may be much better than > calling it "--autostash".
That's an interesting idea and I gave it a shot! I do worry about breaking the existing '-m' flow because I don't understand its fundamentals.
But tests old seem to be passing (well, they did break and then I fixed the code to make them pass again), so that's promising. Although hard for me to say if the old test coverage protects against all possible regressions.
> Other than that, I like the implementation in general.
Thanks for all your support, Junio!
Harald