From: Eric Sunshine Date: Thu, 26 Jul 2018 19:08:32 GMT Subject: Re: [PATCH v1] checkout: optionally speed up "git checkout -b foo" Message-ID: In-Reply-To: On Thu, Jul 26, 2018 at 2:59 PM Eric Sunshine wrote: > On Thu, Jul 26, 2018 at 11:04 AM Junio C Hamano wrote: > > If there were a simple and futureproof way to tell the option > > parsing loop to notice any feature other than "-b newbranch" was > > used, then such a whitelisting may be a viable way [...] > > I'm wondering if a two-stage parse-options invocations could make this > potential maintenance problem more manageable by altogether > eliminating needs_working_tree_merge(). A downside of this approach is that it too becomes a nightmare if git-checkout grows additional special cases like the proposed "-b", in which case multi-stage or disjoint or intersecting parse-options invocations might arise. Another downside is that this parse-options idea is somewhat invasive, whereas, needs_working_tree_merge(), despite its ugliness, is at least is self-contained and not at all invasive.