From 8fdd248d199e888af0b969014b9c3f485f744eaa Mon Sep 17 00:00:00 2001 From: OpherV Date: Fri, 27 Jun 2014 20:23:36 +0300 Subject: [PATCH 1/5] bump version number to 0.3.8 --- META-INF/plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META-INF/plugin.xml b/META-INF/plugin.xml index 02388f7..40b56df 100644 --- a/META-INF/plugin.xml +++ b/META-INF/plugin.xml @@ -2,7 +2,7 @@ Git Flow Integration Gitflow Git Flow Integration - 0.3.7 + 0.3.8 VCS Integration Opher Vishnia From 82ec789409f36a7edf50c654b2fba1be76d230d7 Mon Sep 17 00:00:00 2001 From: Opher Vishnia Date: Mon, 30 Jun 2014 12:02:07 +0300 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7545d48..32ba425 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Huge shoutout [to Kirill Likhodedov](https://github.com/klikh), who wrote much o The plugin is available via the IntelliJ plugin manager. Just search for "Git Flow Integration" to get the latest version! -(The plugin requires that you have [Vanilla Git Flow](https://github.com/nvie/gitflow) \ [AVH edition](https://github.com/petervanderdoes/gitflow) installed) +(The plugin requires that you have gitflow installed. I *highly* recommend using the [AVH edition](https://github.com/petervanderdoes/gitflow), rather than [Vanilla Git Flow](https://github.com/nvie/gitflow) since the original isn't being maintained anymore) **Mac/Linux users:** From 02e83d76e5dff148292282be1132b59aedef2083 Mon Sep 17 00:00:00 2001 From: OpherV Date: Tue, 5 Aug 2014 16:58:19 +0300 Subject: [PATCH 3/5] bump version to 0.3.8 --- META-INF/plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META-INF/plugin.xml b/META-INF/plugin.xml index 40b56df..decae61 100644 --- a/META-INF/plugin.xml +++ b/META-INF/plugin.xml @@ -2,7 +2,7 @@ Git Flow Integration Gitflow Git Flow Integration - 0.3.8 + 0.3.9 VCS Integration Opher Vishnia From 69018f9c2410359ffd12c94d89fa655e399abd75 Mon Sep 17 00:00:00 2001 From: OpherV Date: Tue, 5 Aug 2014 17:01:27 +0300 Subject: [PATCH 4/5] fix for #49, EAP compatibility breaking change: GitLineHandlerPasswordRequestAware to GitLineHandler --- src/gitflow/GitflowImpl.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gitflow/GitflowImpl.java b/src/gitflow/GitflowImpl.java index a34839b..ea77046 100644 --- a/src/gitflow/GitflowImpl.java +++ b/src/gitflow/GitflowImpl.java @@ -126,7 +126,7 @@ public GitCommandResult startFeature(@NotNull GitRepository repository, public GitCommandResult finishFeature(@NotNull GitRepository repository, @NotNull String featureName, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); @@ -145,7 +145,7 @@ public GitCommandResult finishFeature(@NotNull GitRepository repository, public GitCommandResult publishFeature(@NotNull GitRepository repository, @NotNull String featureName, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); @@ -166,7 +166,7 @@ public GitCommandResult pullFeature(@NotNull GitRepository repository, @NotNull String featureName, @NotNull GitRemote remote, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); h.addParameters("feature"); @@ -184,7 +184,7 @@ public GitCommandResult trackFeature(@NotNull GitRepository repository, @NotNull String featureName, @NotNull GitRemote remote, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); h.addParameters("feature"); @@ -220,7 +220,7 @@ public GitCommandResult finishRelease(@NotNull GitRepository repository, @NotNull String releaseName, @NotNull String tagMessage, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); @@ -250,7 +250,7 @@ public GitCommandResult finishRelease(@NotNull GitRepository repository, public GitCommandResult publishRelease(@NotNull GitRepository repository, @NotNull String releaseName, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); @@ -268,7 +268,7 @@ public GitCommandResult publishRelease(@NotNull GitRepository repository, public GitCommandResult trackRelease(@NotNull GitRepository repository, @NotNull String releaseName, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); @@ -305,7 +305,7 @@ public GitCommandResult finishHotfix(@NotNull GitRepository repository, @NotNull String hotfixName, @NotNull String tagMessage, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); @@ -335,7 +335,7 @@ public GitCommandResult finishHotfix(@NotNull GitRepository repository, public GitCommandResult publishHotfix(@NotNull GitRepository repository, @NotNull String hotfixName, @Nullable GitLineHandlerListener... listeners) { - final GitLineHandlerPasswordRequestAware h = new GitLineHandlerPasswordRequestAware(repository.getProject(), repository.getRoot(), GitflowCommand()); + final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitflowCommand()); setUrl(h, repository); h.setSilent(false); @@ -350,7 +350,7 @@ public GitCommandResult publishHotfix(@NotNull GitRepository repository, return run(h); } - private void setUrl (GitLineHandlerPasswordRequestAware h, GitRepository repository){ + private void setUrl (GitLineHandler h, GitRepository repository){ ArrayList remotes = new ArrayList(repository.getRemotes()); //make sure a remote repository is available From 037d92728832a8e6701dd69455ff6cc6ad9ae8fd Mon Sep 17 00:00:00 2001 From: OpherV Date: Tue, 5 Aug 2014 18:25:12 +0300 Subject: [PATCH 5/5] implement #48, --keepremote flag --- src/gitflow/GitflowConfigurable.java | 49 ++++++++++++++++++-------- src/gitflow/GitflowImpl.java | 5 +++ src/gitflow/ui/GitflowOptionsForm.form | 39 +++++++++++++++++--- src/gitflow/ui/GitflowOptionsForm.java | 46 ++++++++++++++---------- 4 files changed, 102 insertions(+), 37 deletions(-) diff --git a/src/gitflow/GitflowConfigurable.java b/src/gitflow/GitflowConfigurable.java index 4d8a01d..7a81b6b 100644 --- a/src/gitflow/GitflowConfigurable.java +++ b/src/gitflow/GitflowConfigurable.java @@ -15,6 +15,8 @@ */ public class GitflowConfigurable implements Configurable { + public static final String GITFLOW_FEATURE_KEEP_REMOTE = "Gitflow.featureKeepRemote"; + public static final String GITFLOW_PUSH_ON_FINISH_RELEASE = "Gitflow.pushOnFinishRelease"; public static final String GITFLOW_PUSH_ON_FINISH_HOTFIX = "Gitflow.pushOnFinishHotfix"; public static final String GITFLOW_DONT_TAG_RELEASE = "Gitflow.dontTagRelease"; @@ -36,22 +38,23 @@ public GitflowConfigurable(Project project) this.project = project; } + /* feature */ + + public static boolean featureKeepRemote(Project project) { + return PropertiesComponent.getInstance(project).getBoolean(GitflowConfigurable.GITFLOW_FEATURE_KEEP_REMOTE, false); + } + + /* release */ + public static boolean pushOnReleaseFinish(Project project) { return PropertiesComponent.getInstance(project).getBoolean(GitflowConfigurable.GITFLOW_PUSH_ON_FINISH_RELEASE, false); } - public static boolean pushOnHotfixFinish(Project project) { - return PropertiesComponent.getInstance(project).getBoolean(GitflowConfigurable.GITFLOW_PUSH_ON_FINISH_HOTFIX, false); - } public static boolean dontTagRelease(Project project) { return PropertiesComponent.getInstance(project).getBoolean(GitflowConfigurable.GITFLOW_DONT_TAG_RELEASE, false); } - public static boolean dontTagHotfix(Project project) { - return PropertiesComponent.getInstance(project).getBoolean(GitflowConfigurable.GITFLOW_DONT_TAG_HOTFIX, false); - } - /* finish release custom commit message */ public static boolean useCustomTagCommitMessage(Project project) { @@ -67,6 +70,17 @@ public static String getCustomTagCommitMessage(Project project) { } } + /*hotfix*/ + + public static boolean pushOnHotfixFinish(Project project) { + return PropertiesComponent.getInstance(project).getBoolean(GitflowConfigurable.GITFLOW_PUSH_ON_FINISH_HOTFIX, false); + } + + public static boolean dontTagHotfix(Project project) { + return PropertiesComponent.getInstance(project).getBoolean(GitflowConfigurable.GITFLOW_DONT_TAG_HOTFIX, false); + } + + /* finish hotfix custom commit message */ public static boolean useCustomHotfixTagCommitMessage(Project project) { return PropertiesComponent.getInstance(project).getBoolean(GitflowConfigurable.GITFLOW_USE_CUSTOM_HOTFIX_TAG_COMMIT_MESSAGE, false); @@ -103,12 +117,15 @@ public JComponent createComponent() { @Override public boolean isModified() { - return PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_RELEASE, false) != gitflowOptionsForm.isPushOnFinishRelease() || - PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_HOTFIX, false) != gitflowOptionsForm.isPushOnFinishHotfix() || + return PropertiesComponent.getInstance(project).getBoolean(GITFLOW_FEATURE_KEEP_REMOTE, false) != gitflowOptionsForm.isFeatureKeepRemote() || + + PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_RELEASE, false) != gitflowOptionsForm.isPushOnFinishRelease() || PropertiesComponent.getInstance(project).getBoolean(GITFLOW_DONT_TAG_RELEASE, false) != gitflowOptionsForm.isDontTagRelease() || - PropertiesComponent.getInstance(project).getBoolean(GITFLOW_DONT_TAG_HOTFIX, false) != gitflowOptionsForm.isDontTagHotfix() || PropertiesComponent.getInstance(project).getBoolean(GITFLOW_USE_CUSTOM_TAG_COMMIT_MESSAGE, false) != gitflowOptionsForm.isUseCustomTagCommitMessage() || PropertiesComponent.getInstance(project).getValue(GITFLOW_CUSTOM_TAG_COMMIT_MESSAGE, DEFAULT_TAG_COMMIT_MESSAGE).equals(gitflowOptionsForm.getCustomTagCommitMessage())==false || + + PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_HOTFIX, false) != gitflowOptionsForm.isPushOnFinishHotfix() || + PropertiesComponent.getInstance(project).getBoolean(GITFLOW_DONT_TAG_HOTFIX, false) != gitflowOptionsForm.isDontTagHotfix() || PropertiesComponent.getInstance(project).getBoolean(GITFLOW_USE_CUSTOM_HOTFIX_TAG_COMMIT_MESSAGE, false) != gitflowOptionsForm.isUseCustomHotfixComitMessage() || PropertiesComponent.getInstance(project).getValue(GITFLOW_CUSTOM_HOTFIX_TAG_COMMIT_MESSAGE, DEFAULT_TAG_HOTFIX_COMMIT_MESSAGE).equals(gitflowOptionsForm.getCustomHotfixCommitMessage())==false ; @@ -116,26 +133,30 @@ public boolean isModified() { @Override public void apply() throws ConfigurationException { + PropertiesComponent.getInstance(project).setValue(GITFLOW_FEATURE_KEEP_REMOTE, Boolean.toString(gitflowOptionsForm.isFeatureKeepRemote())); + PropertiesComponent.getInstance(project).setValue(GITFLOW_PUSH_ON_FINISH_RELEASE, Boolean.toString(gitflowOptionsForm.isPushOnFinishRelease())); - PropertiesComponent.getInstance(project).setValue(GITFLOW_PUSH_ON_FINISH_HOTFIX, Boolean.toString(gitflowOptionsForm.isPushOnFinishHotfix())); PropertiesComponent.getInstance(project).setValue(GITFLOW_DONT_TAG_RELEASE, Boolean.toString(gitflowOptionsForm.isDontTagRelease())); - PropertiesComponent.getInstance(project).setValue(GITFLOW_DONT_TAG_HOTFIX, Boolean.toString(gitflowOptionsForm.isDontTagHotfix())); PropertiesComponent.getInstance(project).setValue(GITFLOW_USE_CUSTOM_TAG_COMMIT_MESSAGE, Boolean.toString(gitflowOptionsForm.isUseCustomTagCommitMessage())); PropertiesComponent.getInstance(project).setValue(GITFLOW_CUSTOM_TAG_COMMIT_MESSAGE, gitflowOptionsForm.getCustomTagCommitMessage()); + PropertiesComponent.getInstance(project).setValue(GITFLOW_PUSH_ON_FINISH_HOTFIX, Boolean.toString(gitflowOptionsForm.isPushOnFinishHotfix())); + PropertiesComponent.getInstance(project).setValue(GITFLOW_DONT_TAG_HOTFIX, Boolean.toString(gitflowOptionsForm.isDontTagHotfix())); PropertiesComponent.getInstance(project).setValue(GITFLOW_USE_CUSTOM_HOTFIX_TAG_COMMIT_MESSAGE, Boolean.toString(gitflowOptionsForm.isUseCustomHotfixComitMessage())); PropertiesComponent.getInstance(project).setValue(GITFLOW_CUSTOM_HOTFIX_TAG_COMMIT_MESSAGE, gitflowOptionsForm.getCustomHotfixCommitMessage()); } @Override public void reset() { + gitflowOptionsForm.setFeatureKeepRemote(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_FEATURE_KEEP_REMOTE, false)); + gitflowOptionsForm.setPushOnFinishRelease(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_RELEASE, false)); - gitflowOptionsForm.setPushOnFinishHotfix(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_HOTFIX, false)); gitflowOptionsForm.setDontTagRelease(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_DONT_TAG_RELEASE, false)); - gitflowOptionsForm.setDontTagHotfix(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_DONT_TAG_HOTFIX, false)); gitflowOptionsForm.setUseCustomTagCommitMessage(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_USE_CUSTOM_TAG_COMMIT_MESSAGE, false)); gitflowOptionsForm.setCustomTagCommitMessage(PropertiesComponent.getInstance(project).getValue(GITFLOW_CUSTOM_TAG_COMMIT_MESSAGE,DEFAULT_TAG_COMMIT_MESSAGE)); + gitflowOptionsForm.setPushOnFinishHotfix(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_PUSH_ON_FINISH_HOTFIX, false)); + gitflowOptionsForm.setDontTagHotfix(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_DONT_TAG_HOTFIX, false)); gitflowOptionsForm.setUseCustomHotfixCommitMessage(PropertiesComponent.getInstance(project).getBoolean(GITFLOW_USE_CUSTOM_HOTFIX_TAG_COMMIT_MESSAGE, false)); gitflowOptionsForm.setCustomHotfixCommitMessage(PropertiesComponent.getInstance(project).getValue(GITFLOW_CUSTOM_HOTFIX_TAG_COMMIT_MESSAGE,DEFAULT_TAG_HOTFIX_COMMIT_MESSAGE)); } diff --git a/src/gitflow/GitflowImpl.java b/src/gitflow/GitflowImpl.java index ea77046..58f8506 100644 --- a/src/gitflow/GitflowImpl.java +++ b/src/gitflow/GitflowImpl.java @@ -133,6 +133,11 @@ public GitCommandResult finishFeature(@NotNull GitRepository repository, h.addParameters("feature"); h.addParameters("finish"); + + if (GitflowConfigurable.featureKeepRemote(repository.getProject())) { + h.addParameters("--keepremote"); + } + h.addParameters(featureName); for (GitLineHandlerListener listener : listeners) { diff --git a/src/gitflow/ui/GitflowOptionsForm.form b/src/gitflow/ui/GitflowOptionsForm.form index 9ef8839..46aa43a 100644 --- a/src/gitflow/ui/GitflowOptionsForm.form +++ b/src/gitflow/ui/GitflowOptionsForm.form @@ -1,22 +1,22 @@
- + - + - + - + @@ -64,7 +64,7 @@ - + @@ -109,6 +109,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/gitflow/ui/GitflowOptionsForm.java b/src/gitflow/ui/GitflowOptionsForm.java index cb33206..a4b2c6d 100644 --- a/src/gitflow/ui/GitflowOptionsForm.java +++ b/src/gitflow/ui/GitflowOptionsForm.java @@ -9,15 +9,18 @@ * @author Opher Vishnia (opherv@gmail.com) */ public class GitflowOptionsForm implements ItemListener { - private JCheckBox pushOnFinishRelease; private JPanel contentPane; - private JCheckBox pushOnFinishHotfix; + private JCheckBox featureKeepRemote; + + private JCheckBox pushOnFinishRelease; private JCheckBox dontTagRelease; private JCheckBox useCustomTagCommitMessage; private JTextField customTagCommitMessage; - private JTextField customHotfixCommitMessage; - private JCheckBox useCustomHotfixCommitMessage; + + private JCheckBox pushOnFinishHotfix; private JCheckBox dontTagHotfix; + private JCheckBox useCustomHotfixCommitMessage; + private JTextField customHotfixCommitMessage; public JPanel getContentPane() { dontTagRelease.addItemListener(this); @@ -83,6 +86,8 @@ else if (source == dontTagHotfix) { } + // getters/setters + public boolean isPushOnFinishRelease() { return pushOnFinishRelease.isSelected(); @@ -93,23 +98,11 @@ public void setPushOnFinishRelease(boolean selected) pushOnFinishRelease.setSelected(selected); } - public boolean isPushOnFinishHotfix() { - return pushOnFinishHotfix.isSelected(); - } - - public void setPushOnFinishHotfix(boolean selected) { - pushOnFinishHotfix.setSelected(selected); - } - public boolean isDontTagRelease() { return dontTagRelease.isSelected(); } - public boolean isDontTagHotfix() { return dontTagHotfix.isSelected(); } - - public void setDontTagRelease(boolean selected) { - dontTagRelease.setSelected(selected); - } + public boolean isFeatureKeepRemote() { return featureKeepRemote.isSelected(); } - public void setDontTagHotfix(boolean selected) { dontTagHotfix.setSelected(selected); } + public void setFeatureKeepRemote(boolean selected) { featureKeepRemote.setSelected(selected); } /* custom finish release tag commit message */ @@ -130,6 +123,23 @@ public void setCustomTagCommitMessage(String message) { customTagCommitMessage.setText(message); } + + + public boolean isPushOnFinishHotfix() { return pushOnFinishHotfix.isSelected(); } + + public void setPushOnFinishHotfix(boolean selected) { pushOnFinishHotfix.setSelected(selected); } + + + public boolean isDontTagHotfix() { return dontTagHotfix.isSelected(); } + + public void setDontTagRelease(boolean selected) { + dontTagRelease.setSelected(selected); + } + + public void setDontTagHotfix(boolean selected) { dontTagHotfix.setSelected(selected); } + + + /* custom finish hotfix commit message */ public boolean isUseCustomHotfixComitMessage(){