Re: [PATCH v2] checkout: optimize "git checkout -b "

2018-08-15 Thread Ben Peart
On 8/6/2018 10:25 AM, Ben Peart wrote: On 8/3/2018 11:58 AM, Duy Nguyen wrote: On Thu, Aug 02, 2018 at 02:02:00PM -0400, Ben Peart wrote: But if you still want to push it further, this is something I have in mind. It probably has bugs, but at least preliminary test shows me that it

Re: [PATCH v2] checkout: optimize "git checkout -b "

2018-08-06 Thread Ben Peart
On 8/3/2018 11:58 AM, Duy Nguyen wrote: On Thu, Aug 02, 2018 at 02:02:00PM -0400, Ben Peart wrote: But if you still want to push it further, this is something I have in mind. It probably has bugs, but at least preliminary test shows me that it could skip 99% work inside unpack_trees()

Re: [PATCH v2] checkout: optimize "git checkout -b "

2018-08-05 Thread Duy Nguyen
On Thu, Aug 02, 2018 at 02:02:00PM -0400, Ben Peart wrote: > > And if all go according to plan, there will be no changes made in the > > index (by either 2-way merge or sparse checkout stuff) we should be > > able to just skip writing down the index, if we haven't done that > > already. > > > >

Re: [PATCH v2] checkout: optimize "git checkout -b "

2018-08-03 Thread Duy Nguyen
On Thu, Aug 02, 2018 at 02:02:00PM -0400, Ben Peart wrote: > > > On 8/1/2018 11:10 AM, Duy Nguyen wrote: > > On Tue, Jul 31, 2018 at 7:03 PM Ben Peart wrote: > >> > >> From: Ben Peart > >> > >> Skip merging the commit, updating the index and working directory if and > >> only if we are

Re: [PATCH v2] checkout: optimize "git checkout -b "

2018-08-02 Thread Ben Peart
On 8/1/2018 11:10 AM, Duy Nguyen wrote: On Tue, Jul 31, 2018 at 7:03 PM Ben Peart wrote: From: Ben Peart Skip merging the commit, updating the index and working directory if and only if we are creating a new branch via "git checkout -b ." Any other checkout options will still go through

Re: [PATCH v2] checkout: optimize "git checkout -b "

2018-08-01 Thread Duy Nguyen
On Tue, Jul 31, 2018 at 7:03 PM Ben Peart wrote: > > From: Ben Peart > > Skip merging the commit, updating the index and working directory if and > only if we are creating a new branch via "git checkout -b ." > Any other checkout options will still go through the former code path. I'd like to

Re: [PATCH v2] checkout: optimize "git checkout -b "

2018-07-31 Thread Junio C Hamano
Ben Peart writes: > The biggest change in this version was suggested in feedback to the last > patch. I have turned on the optimzation by default if sparse-checkout is > not on so that most users do not have to set anything and they will get the > benefit of the optimization. Sounds like a

[PATCH v2] checkout: optimize "git checkout -b "

2018-07-31 Thread Ben Peart
From: Ben Peart Skip merging the commit, updating the index and working directory if and only if we are creating a new branch via "git checkout -b ." Any other checkout options will still go through the former code path. If sparse_checkout is on, require the user to manually opt in to this