aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Doninger2011-02-27 16:59:16 (EST)
committerMatthias Sohn2011-02-27 16:59:16 (EST)
commitaabcdc3475daffa53767991ac5fb7dd1d767b979 (patch)
tree4a6eb9564b0b5d1d24d031cf83ad5b9a3ed37588
parent230a0af2e169aed34c1ea7f9f1c0d5846a3ca298 (diff)
downloadegit-aabcdc3475daffa53767991ac5fb7dd1d767b979.zip
egit-aabcdc3475daffa53767991ac5fb7dd1d767b979.tar.gz
egit-aabcdc3475daffa53767991ac5fb7dd1d767b979.tar.bz2
Configuration for creating Gerrit Change-Idrefs/changes/08/2608/3
This change provides a new checkbox in the commit dialog preference page to select, if a Gerrit Change-Id should be automatically created for every commit. Bug: 337939 Change-Id: I493cade9c8b8239c3aa97b3298a00073ecdcff2e Signed-off-by: Manuel Doninger <manuel.doninger@googlemail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/CommitDialogPreferencePage.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties2
6 files changed, 29 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java
index b0ac136..f1842e2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/PluginPreferenceInitializer.java
@@ -67,6 +67,7 @@ public class PluginPreferenceInitializer extends AbstractPreferenceInitializer {
store.setDefault(UIPreferences.FINDTOOLBAR_IGNORE_CASE, true);
store.setDefault(UIPreferences.FINDTOOLBAR_FIND_IN, 2);
store.setDefault(UIPreferences.COMMIT_DIALOG_HARD_WRAP_MESSAGE, true);
+ store.setDefault(UIPreferences.COMMIT_DIALOG_CREATE_CHANGE_ID, false);
store.setDefault(UIPreferences.REFESH_ON_INDEX_CHANGE, true);
store.setDefault(UIPreferences.REFESH_ONLY_WHEN_ACTIVE, true);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java
index df3a394..be2dd3f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java
@@ -53,6 +53,8 @@ public class UIPreferences {
public final static String FINDTOOLBAR_FIND_IN = "findtoolbar_find_in"; //$NON-NLS-1$
/** */
public final static String COMMIT_DIALOG_HARD_WRAP_MESSAGE = "commit_dialog_hard_wrap_message"; //$NON-NLS-1$
+ /** */
+ public final static String COMMIT_DIALOG_CREATE_CHANGE_ID = "commit_dialog_create_change_id"; //$NON-NLS-1$
/** */
public final static String THEME_CommitGraphNormalFont = "org.eclipse.egit.ui.CommitGraphNormalFont"; //$NON-NLS-1$
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
index 1e0cf78..b410cae 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
@@ -2308,6 +2308,12 @@ public class UIText extends NLS {
public static String CommitDialogPreferencePage_hardWrapMessageTooltip;
/** */
+ public static String CommitDialogPreferencePage_createChangeId;
+
+ /** */
+ public static String CommitDialogPreferencePage_createChangeIdTooltip;
+
+ /** */
public static String Decorator_exceptionMessage;
/** */
@@ -3384,6 +3390,7 @@ public class UIText extends NLS {
/** */
public static String GitActionContributor_ExpandAll;
+ /** */
static {
initializeMessages(BUNDLE_NAME, UIText.class);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
index 66a7dbb..687da91 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
@@ -42,6 +42,7 @@ import org.eclipse.egit.core.internal.storage.GitFileHistoryProvider;
import org.eclipse.egit.core.op.AddToIndexOperation;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.ui.ICommitMessageProvider;
+import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.UIText;
import org.eclipse.egit.ui.UIUtils;
import org.eclipse.egit.ui.UIUtils.IPreviousValueProposalHandler;
@@ -350,6 +351,10 @@ public class CommitDialog extends Dialog {
}
});
+ changeIdButton.setSelection( org.eclipse.egit.ui.Activator.getDefault().getPreferenceStore()
+ .getBoolean(UIPreferences.COMMIT_DIALOG_CREATE_CHANGE_ID));
+ refreshChangeIdText();
+
showUntrackedButton = new Button(container, SWT.CHECK);
showUntrackedButton.setText(UIText.CommitDialog_ShowUntrackedFiles);
showUntrackedButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());
@@ -378,6 +383,7 @@ public class CommitDialog extends Dialog {
updateChangeIdButton();
}
});
+
updateSignedOffButton();
updateChangeIdButton();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/CommitDialogPreferencePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/CommitDialogPreferencePage.java
index 8c85546..92ed146 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/CommitDialogPreferencePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/CommitDialogPreferencePage.java
@@ -21,6 +21,7 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
public class CommitDialogPreferencePage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
+
/** */
public CommitDialogPreferencePage() {
super(GRID);
@@ -44,5 +45,15 @@ public class CommitDialogPreferencePage extends FieldEditorPreferencePage
getFieldEditorParent());
hardWrap.getDescriptionControl(getFieldEditorParent()).setToolTipText(UIText.CommitDialogPreferencePage_hardWrapMessageTooltip);
addField(hardWrap);
+
+ BooleanFieldEditor createChangeId = new BooleanFieldEditor(
+ UIPreferences.COMMIT_DIALOG_CREATE_CHANGE_ID,
+ UIText.CommitDialogPreferencePage_createChangeId,
+ getFieldEditorParent());
+ createChangeId
+ .getDescriptionControl(getFieldEditorParent())
+ .setToolTipText(
+ UIText.CommitDialogPreferencePage_createChangeIdTooltip);
+ addField(createChangeId);
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
index a90072c..862b982 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
@@ -741,6 +741,8 @@ RefreshPreferencesPage_RefreshWhenIndexChange=Refresh resources when &index chan
CommitDialogPreferencePage_title=Commit Dialog
CommitDialogPreferencePage_hardWrapMessage=Hard-wrap commit message
CommitDialogPreferencePage_hardWrapMessageTooltip=Wrap text in commit message editor while typing
+CommitDialogPreferencePage_createChangeId=Default to insert Change-Id for Gerrit Code Review
+CommitDialogPreferencePage_createChangeIdTooltip=Insert Change-Id for Gerrit Code Review by default
BasicConfigurationDialog_DialogMessage=Git needs your name and e-mail to correctly attribute your commits. Git uses name and e-mail to identify author and committer of a commit.
BasicConfigurationDialog_DialogTitle=Please identify yourself