Re: [PATCH v3 10/21] checkout: split part of it to new command 'switch'
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 14, 2019, 14:13 UTC
- Message-ID
- <CACsJy8BATpbAG8hDs6n2sfDCgY_XTJtU0MRxT+2FpHETqr+bCg@mail.gmail.com>
- In-Reply-To
- <7d3742d6-73e4-2750-6ecb-9edf761d96dd@gmail.com>
On Mon, Mar 11, 2019 at 6:16 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 13 quoted lines
> > +-f:: > > +--force:: > > + Proceed even if the index or the working tree differs from > > + HEAD. Both the index and working tree are restored to match > > + the switching target. This is used to throw away local > > + changes. > > I'd always thought that --force meant "throw away my local changes if > they conflict with the new branch" not "throw them away regardless" > (which is better as it is deterministic). Maybe we can come up with a > clearer name here --discard-changes? At the moment --force does not > throw away conflicts properly (see the script below in my comments about > --merge).
First victim of --discard-changes (or maybe I misread your comment), it's too much to type even with completion and I'm so used to the short and sweet "switch -[d]f".
Unless people object, I'm going to keep --force as an alias for --discard-changes. -f could be extended later to cover more --ignore-stuff when it makes sense.
-- Duy