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

2016-09-28 Thread Junio C Hamano
"Ben Peart" writes: > The fact that "git checkout -b NEW" updates the index and as a > result reflects any changes in the sparse-checkout and the issue > Junio pointed out earlier about not calling show_local_changes > at the end of merge_working_tree are the only difference in behavior > I am

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

2016-09-28 Thread Ben Peart
Re: [PATCH v3] checkout: eliminate unnecessary merge for trivial > checkout > > Hi Junio, > > From: "Junio C Hamano" > > "Philip Oakley" writes: > > > >>> > >"git checkout -b foo" (without -f -m or ) is defined > &

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

2016-09-24 Thread Philip Oakley
Hi Junio, From: "Junio C Hamano" "Philip Oakley" writes: > >"git checkout -b foo" (without -f -m or ) is defined in > >the manual as being a shortcut for/equivalent to: > > > >(1a) "git branch foo" > >(1b) "git checkout foo" > > > >However, it has been our experience in our o

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

2016-09-24 Thread Junio C Hamano
"Philip Oakley" writes: >> > >"git checkout -b foo" (without -f -m or ) is defined in >> > >the manual as being a shortcut for/equivalent to: >> > > >> > >(1a) "git branch foo" >> > >(1b) "git checkout foo" >> > > >> > >However, it has been our experience in our observed use cases

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

2016-09-24 Thread Philip Oakley
Ben, Using a 'bottom / in-line' posting flow is much preferred, which may require some manual editing[1], hopefully I have it about right... Philip -- [1] this is massaged and mangled Outlook Express, sometimes one has to work with the tools at hand... From: "Ben Peart" From: Junio C Hamano

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

2016-09-21 Thread Ben Peart
[PATCH v3] checkout: eliminate unnecessary merge for trivial checkout Junio C Hamano writes: >> "git checkout -b foo" (without -f -m or ) is defined in >> the manual as being a shortcut for/equivalent to: >> >> (1a) "git branch foo" >>

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

2016-09-19 Thread Junio C Hamano
Junio C Hamano writes: >> "git checkout -b foo" (without -f -m or ) is defined in the >> manual as being a shortcut for/equivalent to: >> >> (1a) "git branch foo" >> (1b) "git checkout foo" >> >> However, it has been our experience in our observed use cases and all the >> exis

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

2016-09-19 Thread Junio C Hamano
"Ben Peart" writes: > Let me see if I can better explain what I’m trying to accomplish with this > patch. > > "git checkout -b foo" (without -f -m or ) is defined in the > manual as being a shortcut for/equivalent to: > > (1a) "git branch foo" > (1b) "git checkout foo" > >

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

2016-09-19 Thread Ben Peart
; To: Ben Peart <mailto:peart...@gmail.com> > Cc: mailto:git@vger.kernel.org; mailto:pclo...@gmail.com; Ben Peart > <mailto:ben.pe...@microsoft.com> > Subject: Re: [PATCH v3] checkout: eliminate unnecessary merge for trivial > checkout > > Ben Peart <mailto:peart...@gm

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

2016-09-14 Thread Junio C Hamano
Oleg Taranenko writes: > Sorry for bothering, why not introduce a brand new option like git > checkout -b foo --skip-worktree-merge for such rare optimization use > case? I am not sure what problem such a new option solves. How would you describe and explain what "--skip-worktree-merge" option

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

2016-09-13 Thread Oleg Taranenko
Sorry for bothering, why not introduce a brand new option like git checkout -b foo --skip-worktree-merge for such rare optimization use case? On Wed, Sep 14, 2016 at 12:34 AM, Junio C Hamano wrote: > Ben Peart writes: > >> +static int needs_working_tree_merge(const struct checkout_opts *opts, >>

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

2016-09-13 Thread Junio C Hamano
Ben Peart writes: > +static int needs_working_tree_merge(const struct checkout_opts *opts, > + const struct branch_info *old, > + const struct branch_info *new) > +{ > +... > +} I do not think I need to repeat the same remarks on the conditions in this helper, which hasn't changed since

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

2016-09-13 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