Re: [PATCH v1] checkout: optionally speed up "git checkout -b foo"
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 26, 2018, 19:08 UTC
- Message-ID
- <CAPig+cRgJh2+1wdQS3a8Vd+D0VDPwLO8HXGYZ6MhkCK3ww47sA@mail.gmail.com>
- In-Reply-To
- <CAPig+cRtUeSCUnUFw0xgXEV7nyBiORZSLfLYfhKWjXxcgHvQmg@mail.gmail.com>
On Thu, Jul 26, 2018 at 2:59 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 8 quoted lines
> On Thu, Jul 26, 2018 at 11:04 AM Junio C Hamano <gitster@pobox.com> 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.