DESCRIPTION

Introduce a mergeStrategy extension point.

Preference page for users to select the strategy they want.
Make sure that relevant operations use the preferred strategy.

Change-Id: I4d455ce171cca13c780e72b8d27dd929b28c6b71
Signed-off-by: Maleah Marks xxx@xxx.xxx


COMMENTS

author: Maleah Marks
date: 2015-08-26 14:39:21.000000000

Uploaded patch set 6.

-------------------------------------
author: Brenden Conley
date: 2015-08-26 14:39:27.000000000

Patch Set 6:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/7465/

-------------------------------------
author: Brenden Conley
date: 2015-08-26 14:59:27.000000000

Patch Set 6: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/7465/ : UNSTABLE

-------------------------------------
author: Brenden Conley
date: 2015-08-27 06:43:01.000000000

Patch Set 6: -Code-Review

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/7468/

-------------------------------------
author: Brenden Conley
date: 2015-08-27 07:00:52.000000000

Patch Set 6: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/7468/ : SUCCESS

-------------------------------------
author: Maren Gonzales
date: 2015-08-27 08:46:44.000000000

Patch Set 6: Code-Review+1

Thanks for the review and the revision! I had a look through the code and successfully tested it with an ad-hoc adaptation of the EMF model provider. Looks great to me!

-------------------------------------
author: Douglas Trujillo
date: 2015-08-27 15:22:27.000000000

Patch Set 6: Code-Review-1

(16 comments)

* please rebase this change on origin/master and resolve conflicts
* I think in another change we should also allow the user to choose the merge strategy ad-hoc in the dialog starting an operation using merge strategy (e.g. merge). This choice should then also list all the strategies implemented by JGit.
* this is the outcome of bug 418151 so I think it would make sense to link it and update the bug about how we arrived at this approach introducing an extension point instead of implementing a merge driver, this would help to capture the picture around logical model merge

Line:9, org.eclipse.egit.core/schema/mergeStrategy.exsd -> s/to customize the merge strategy/to implement and register custom merge strategies which can be/

Line:26, org.eclipse.egit.core/schema/mergeStrategy.exsd -> replace the trailing whitespace by some documentation for this attribute, same below

Line:245, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties -> maybe we should explicitly mention which operations are affected

Line:13, org.eclipse.egit.core/plugin.properties -> maybe better

s/MergeStrategy-point.name/MergeStrategy-extension-point.name/

Line:173, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> s/model merge/merge/

Line:174, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> s/model merge/merge/

Line:176, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> s/registered with/registered by class {0} with/

Line:176, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> s/{1}/{1} implemented by class {2}/

Line:246, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> xxx@xxx.xxx 4.1 tag for new API

Line:267, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> xxx@xxx.xxx 4.1 tag for new API

Line:596, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> s/registered MergeStrategy/MergeStrategy which can be registered with the mergeStrategy extension point/

Line:598, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> xxx@xxx.xxx 4.1 tag for new API

Line:607, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> how to prevent name clashes if there are multiple implementors of the extension point ? I would at least add the implementation class name so that in case of clashes we can display an error stating which classes implement clashing strategy names

Line:694, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> I think if this is forbidden it should be logged as an error

Line:698, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> how to prevent name clashes if there are multiple extension point implementations ?

Line:75, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/SynchronizePreferencePage.java -> this looks ugly could you increase the distance between this group and the widgets above, see screenshot http://imgur.com/a0qbsP6

-------------------------------------
author: Maleah Marks
date: 2015-08-28 09:58:49.000000000

Patch Set 6:

(16 comments)

Thanks for the review Matthias!

I've taken your comments into account.

As to the management of name clashes, I have no universal solution.
I consequently improved the documentation of the extension point to advise implementors to use qualified names, and added the possibility to explicitely provide a name to register a MergeStrategy instead of useing its getName() method.

Many thanks again, I hope we're on the right track here!

Line:9, org.eclipse.egit.core/schema/mergeStrategy.exsd -> Done

Line:26, org.eclipse.egit.core/schema/mergeStrategy.exsd -> Done

Line:245, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties -> Done

Line:13, org.eclipse.egit.core/plugin.properties -> Done

Line:173, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> Done

Line:174, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> Done

Line:176, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> Done

Line:176, org.eclipse.egit.core/src/org/eclipse/egit/core/internal/coretext.properties -> Done, adapted because of new optional parameter in extension point.

Line:246, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> Done

Line:267, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> Done

Line:596, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> Done

Line:598, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> Done

Line:607, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> I add the implementation class name.
As to name collisions, see my other comment below.

Line:694, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> Done

Line:698, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> I don't think we really can...
I'll update the extension point documentation to suggest implementors should use qualified names for their MergeStrategy implementations.

I also add an optional attribute "name" to the extension point itself, which would be used if present instead of the result of strategy.getName(). Since JGit allows to register strategies with or without an explicit name, it can be useful.
I think it'll be more flexible that way, but name collisions are still possible.

I try to make the error messages and the extension point documentation as clear as possible about this.

Line:75, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/SynchronizePreferencePage.java -> Done.
I've also added a tooltip text to state the operations that are concerned (it was too long for a label imho)

-------------------------------------
author: Maleah Marks
date: 2015-08-28 10:16:43.000000000

Patch Set 6:

I still need to rebase the change, I'm working on it.

-------------------------------------
author: Gerrit Johnathan Pham
date: 2015-08-31 09:36:26.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

-------------------------------------
author: Maleah Marks
date: 2015-09-07 09:29:23.000000000

Patch Set 6:

Matthias, you mentioned that:
"I think in another change we should also allow the user to choose the merge strategy ad-hoc in the dialog starting an operation using merge strategy (e.g. merge). This choice should then also list all the strategies implemented by JGit."

Should I open an "enhancement" bugzilla to track this?

I just pushed a preliminary wip about that.

-------------------------------------
