On Thu, Jul 26, 2018 at 2:59 PM Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote: > On Thu, Jul 26, 2018 at 11:04 AM Junio C Hamano <gitster@xxxxxxxxx> 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.