diff options
| author | Manuel Doninger | 2011-02-27 21:59:16 +0000 |
|---|---|---|
| committer | Matthias Sohn | 2011-02-27 21:59:16 +0000 |
| commit | aabcdc3475daffa53767991ac5fb7dd1d767b979 (patch) | |
| tree | 4a6eb9564b0b5d1d24d031cf83ad5b9a3ed37588 | |
| parent | 230a0af2e169aed34c1ea7f9f1c0d5846a3ca298 (diff) | |
| download | egit-aabcdc3475daffa53767991ac5fb7dd1d767b979.tar.gz egit-aabcdc3475daffa53767991ac5fb7dd1d767b979.tar.xz egit-aabcdc3475daffa53767991ac5fb7dd1d767b979.zip | |
Configuration for creating Gerrit Change-Id
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>
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 b0ac136fec..f1842e2335 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 df3a394e91..be2dd3f543 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 1e0cf7843b..b410caecad 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 66a7dbb8b7..687da91a16 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 8c85546575..92ed1468d3 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 a90072cd29..862b982bab 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 |
