Re: [PATCH 3/3] builtin/checkout: DWIM with -f -b
- From
Jeff King <peff@peff.net>
- Date
- Jun 20, 2010, 20:11 UTC
- Message-ID
- <20100620201137.GA8502@coredump.intra.peff.net>
- In-Reply-To
- <7vvd9dtt54.fsf@alter.siamese.dyndns.org>
On Sun, Jun 20, 2010 at 12:12:55PM -0700, Junio C Hamano wrote:
> I think this is not "DWIM" but is "-f does not work with -b; fix it". > > Will queue; thanks.
I am not sure it is fixing a bug. There are really two possible things to be forced during checkout:
1. throw away local changes
2. overwrite an existing branch
Right now, "checkout -f" means just (1). This patch makes it _also_ mean (2). Do we want to conflate those two cases?
In some sense, it is reasonable for "-f" to mean "force anything that might be questionable". But I wonder if it pays to be a little more conservative given that this is a safety valve we are talking about. The user can of course still split their compound action into:
git branch [-f] new_branch old_branch git checkout [-f] new_branch
Less convenient, but there is no ambiguity.
I dunno. I don't have a strong feeling on how it should be, but I think it is more than a simple bug fix.
-Peff