Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use default preferences to choose merge strategy #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mcartaud
Copy link

The default preferences are only used if the user has not set a
preference through the preferences pages

Signed-off-by: mcartaud [email protected]

final IEclipsePreferences prefs = InstanceScope.INSTANCE
.getNode(Activator.getPluginId());
String preferredMergeStrategyKey = prefs.get(
GitCorePreferences.core_preferredMergeStrategy, null);

// Get preferences defined at eclipse startup with configuration files
if (preferredMergeStrategyKey == null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's very interesting... We probably need to do the same in EMFCompare to allow out users to define default properties wherever they want, don't we?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In EMFCompare the class ScopedPreferenceStore is used to search a specific preference across multiple preferenceStores. This approach seems to be good for managing EGit preferences, but the preferences are managed in egit.core and ScopedPreferenceStore comes from eclipse.ui.

I think the better approach is to manage each store individually, as EGit does

The default preferences are only used if the user has not set a
preference through the preferences pages

Signed-off-by: mcartaud <[email protected]>
@@ -245,6 +245,9 @@
public static String MergeStrategy_UnloadError;

/** */
public static String MergeStrategy_JGit_Default;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a constant, but there's no reason to internationalize it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants