From: Duy Nguyen Date: Thu, 14 Mar 2019 14:13:04 GMT Subject: Re: [PATCH v3 10/21] checkout: split part of it to new command 'switch' Message-ID: In-Reply-To: <7d3742d6-73e4-2750-6ecb-9edf761d96dd@gmail.com> On Mon, Mar 11, 2019 at 6:16 PM Phillip Wood wrote: > > +-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