RE: [PATCH] checkout: eliminate unnecessary merge for trivial checkout

2016-09-09 Thread Ben Peart
> -Original Message- > From: Jeff King [mailto:p...@peff.net] > Sent: Thursday, September 8, 2016 5:38 PM > To: Junio C Hamano > Cc: Ben Peart ; git@vger.kernel.org; > pclo...@gmail.com; =peart...@gmail.com; Ben Peart > > Subject: Re: [PATCH] checkout: elimina

Re: [PATCH] checkout: eliminate unnecessary merge for trivial checkout

2016-09-08 Thread Jeff King
On Thu, Sep 08, 2016 at 02:22:16PM -0700, Junio C Hamano wrote: > > + /* > > +* Optimize the performance of checkout when the current and > > +* new branch have the same OID and avoid the trivial merge. > > +* For example, a "git checkout -b foo" just needs to create > > +* the n

Re: [PATCH] checkout: eliminate unnecessary merge for trivial checkout

2016-09-08 Thread Junio C Hamano
Ben Peart writes: > Teach git to avoid unnecessary merge during trivial checkout. When > running 'git checkout -b foo' git follows a common code path through > the expensive merge_working_tree even when it is unnecessary. I would be lying if I said I am not sympathetic to the cause, but... > +

[PATCH] checkout: eliminate unnecessary merge for trivial checkout

2016-09-08 Thread Ben Peart
Teach git to avoid unnecessary merge during trivial checkout. When running 'git checkout -b foo' git follows a common code path through the expensive merge_working_tree even when it is unnecessary. As a result, 95% of the time is spent in merge_working_tree doing the 2-way merge between the new a