DESCRIPTION

[wip] Use default preferences for preferred MergeStrategy

The default scope was not correctly taken into account.

Bug: 485385
Change-Id: If38c2c4402ae6b1d03e1dc471b3be3885432b995
Signed-off-by: Maleah Marks xxx@xxx.xxx

COMMENTS

author: Maleah Marks
date: 2016-01-20 08:25:06.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-01-20 08:25:12.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2016-01-20 08:50:43.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Maren Gonzales
date: 2016-01-21 16:02:57.000000000

Patch Set 1:

(1 comment)

Looks good, I have a question that I added inline though.

Line:268, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> It looks a bit strange to return rather null than the pereferredMergeStrategy_Default here, if this is actually what has also been stored in either DefaultScope or InstanceScope.

I figure, this is to cause the callers (i.e., the git operations) to fall back to JGit's default operation. But wouldn't it be more clear, if this method would return the JGit default key instead and let the git operations than act accordingly, if this is returned rather than null?

-------------------------------------
author: Maleah Marks
date: 2016-01-21 16:07:32.000000000

Patch Set 1:

(1 comment)

Line:268, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> The problem here is that there is not ONE default JGit key.
The meaning here is to let JGit use its default strategy for the command being invoked. It is up to JGit to decide which is the right default strategy depending on what it's doing, it's not up to JGit to know that, and thus we cannot return one default here IMHO.
We would otherwise assume that JGit uses the same default for merge and rebase and cherry-pick and so on, plus we would also assume that EGit has to know what this default is.
The only way I found to let the JGit default take place is to return null here.

-------------------------------------
author: Maren Gonzales
date: 2016-01-21 16:43:24.000000000

Patch Set 1: Code-Review+1

(1 comment)

Line:268, org.eclipse.egit.core/src/org/eclipse/egit/core/Activator.java -> Yes, I see. What I meant was that it would be more clear if the Activator returns a dedicated MergeStrategy indicating that JGit should decide and the EGit operations, such as RebaseOperation, understand this "let JGit choose" strategy and set the strategy to null.

Ideally, this knowledge about the handling of the "let JGit choose strategy" would be encapsulated in a merge strategy provider so that the EGit operations just call command.setStrategy(mergeStrategyProvider.getStrategy()) and the merge strategy provider knows that it should ask Activator.getPreferredMergeStrategy and that it should return null if the "let JGit choose strategy" is in place.

Anyway, this is just a nitpick. A comment would probably be sufficient around line 268 to explain this strange looking condition.

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-02-05 08:23:02.000000000

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

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