Skip to content

Commit 1a3b137

Browse files
committed
Merge branch 'release/0.7.0'
2 parents f0ff2af + d2ca039 commit 1a3b137

34 files changed

+395
-247
lines changed

README.md

+65-65
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
# Git Flow Integration for Intellij
2-
3-
4-
An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent [Driessen's branching model](http://nvie.com/git-model).
5-
6-
![screenshot](http://opherv.github.io/gitflow4idea/images/gitflow.jpg)
7-
8-
## Supporting my work (so that the plugin doesn't die)
9-
10-
Do you use this free software at work? Great! Would you like it to stay free? Of course you do.
11-
12-
I'm not a Java developer. In fact, I don't even like Java. Still I've been actively supporting this plugin for the past 5+ years on my own free time.
13-
14-
If saved you or your company time and effort, please consider supporting me by buying me a cup of coffee.
15-
Better yet, get your boss to donate 10 cups. It's company money, they won't mind.
16-
17-
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R0TFS7)
18-
19-
## Getting started
20-
21-
For the best introduction to get started with `git flow`, please read Jeff Kreeftmeijer's blog post:
22-
23-
[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
24-
25-
Or have a look at this [cheat sheet](http://danielkummer.github.io/git-flow-cheatsheet/) by Daniel Kummer:
26-
27-
## Who and why
28-
29-
This plugin was created by [Opher Vishnia](http://www.opherv.com), after I couldn't find any similar implementation.
30-
I saw this [suggestion page](http://youtrack.jetbrains.com/issue/IDEA-65491) on the JetBrains site has more than 220 likes and 80 comments, and decided to take up the gauntlet :)
31-
32-
Huge shoutout [to Kirill Likhodedov](https://github.com/klikh), who wrote much of the original git4idea plugin, without which this plugin could not exist
33-
34-
## Installation
35-
36-
The plugin is available via the IntelliJ plugin manager. Just search for "Git Flow Integration" to get the latest version!
37-
38-
(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)
39-
40-
**Mac/Linux users:**
41-
42-
If you're running into issues like getting
43-
`Gitflow is not installed`
44-
or
45-
`git: 'flow' is not a git command. See 'git --help'.`
46-
47-
Please be sure to check out [this thread](https://github.com/OpherV/gitflow4idea/issues/7)
48-
49-
50-
## Caveats
51-
52-
While the plugin is operational and contains all basic functions (init/feature/release/hotfix), it may contains bugs. With your help I'll be able to find and zap them all.
53-
54-
## Helping out
55-
56-
This project is under active development.
57-
If you encounter any bug or an issue, I encourage you to add the them to the [Issues list](https://github.com/OpherV/gitflow4idea/issues) on Github.
58-
Feedback and suggestions are also very welcome.
59-
60-
## License
61-
62-
This plugin is under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).
63-
Copyright 2013-2018, Opher Vishnia.
64-
65-
1+
# Git Flow Integration for Intellij
2+
3+
4+
An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent [Driessen's branching model](http://nvie.com/git-model).
5+
6+
![screenshot](http://opherv.github.io/gitflow4idea/images/gitflow.jpg)
7+
8+
## Supporting my work (so that the plugin doesn't die)
9+
10+
Do you use this free software at work? Great! Would you like it to stay free? Of course you do.
11+
12+
I'm not a Java developer. In fact, I don't even like Java. Still I've been actively supporting this plugin for the past 5+ years on my own free time.
13+
14+
If saved you or your company time and effort, please consider supporting me by buying me a cup of coffee.
15+
Better yet, get your boss to donate 10 cups. It's company money, they won't mind.
16+
17+
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R0TFS7)
18+
19+
## Getting started
20+
21+
For the best introduction to get started with `git flow`, please read Jeff Kreeftmeijer's blog post:
22+
23+
[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
24+
25+
Or have a look at this [cheat sheet](http://danielkummer.github.io/git-flow-cheatsheet/) by Daniel Kummer:
26+
27+
## Who and why
28+
29+
This plugin was created by [Opher Vishnia](http://www.opherv.com), after I couldn't find any similar implementation.
30+
I saw this [suggestion page](http://youtrack.jetbrains.com/issue/IDEA-65491) on the JetBrains site has more than 220 likes and 80 comments, and decided to take up the gauntlet :)
31+
32+
Huge shoutout [to Kirill Likhodedov](https://github.com/klikh), who wrote much of the original git4idea plugin, without which this plugin could not exist
33+
34+
## Installation
35+
36+
The plugin is available via the IntelliJ plugin manager. Just search for "Git Flow Integration" to get the latest version!
37+
38+
(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)
39+
40+
**Mac/Linux users:**
41+
42+
If you're running into issues like getting
43+
`Gitflow is not installed`
44+
or
45+
`git: 'flow' is not a git command. See 'git --help'.`
46+
47+
Please be sure to check out [this thread](https://github.com/OpherV/gitflow4idea/issues/7)
48+
49+
50+
## Caveats
51+
52+
While the plugin is operational and contains all basic functions (init/feature/release/hotfix), it may contains bugs. With your help I'll be able to find and zap them all.
53+
54+
## Helping out
55+
56+
This project is under active development.
57+
If you encounter any bug or an issue, I encourage you to add the them to the [Issues list](https://github.com/OpherV/gitflow4idea/issues) on Github.
58+
Feedback and suggestions are also very welcome.
59+
60+
## License
61+
62+
This plugin is under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).
63+
Copyright 2013-2019, Opher Vishnia.
64+
65+

build.gradle

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ compileJava {
88
}
99

1010
group 'gitflow4idea'
11-
version '0.6.9'
11+
version '0.7.0'
1212

1313
sourceCompatibility = JavaVersion.VERSION_1_8
1414
targetCompatibility = JavaVersion.VERSION_1_8
@@ -29,11 +29,20 @@ intellij {
2929
patchPluginXml {
3030
pluginId "Gitflow"
3131
pluginDescription 'Git Flow Integration'
32-
version '0.6.9'
32+
version '0.7.0'
3333
sinceBuild '182.0'
3434
untilBuild '192.*'
3535
changeNotes """
3636
37+
<H2>Changelog for 0.7.0</H2>
38+
<ul>
39+
<li>Fix NPE when clicking Gitflow menu #245 (@opherv)</li>
40+
<li>Fix "Init gitflow" doesn't update widget #247 (@opherv)</li>
41+
<li>Fix Wrong message when finishing a feature #144 (@opherv)</li>
42+
<li>Feature: Re-init gitflow (access from VCS>Git>Gitflow>Advanced menu) #50 (@bmwsedee/@opherv)</li>
43+
<li>"Feature": Don't show branch select combo on new Hotfix (@opherv)</li>
44+
</ul>
45+
3746
<H2>Changelog for 0.6.9</H2>
3847
<ul>
3948
<li>Support for Idea build 192 #241 (@opherv)</li>

src/main/java/gitflow/Gitflow.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@
1313
*/
1414
public interface Gitflow extends Git {
1515

16-
public GitCommandResult initRepo(@NotNull GitRepository repository,
17-
GitflowInitOptions initOptions, @Nullable GitLineHandlerListener... listeners);
16+
GitCommandResult initRepo(@NotNull GitRepository repository,
17+
GitflowInitOptions initOptions,
18+
@Nullable GitLineHandlerListener... listeners);
19+
20+
GitCommandResult reInitRepo(@NotNull GitRepository repository,
21+
GitflowInitOptions initOptions,
22+
@Nullable GitLineHandlerListener... listeners);
1823

1924

2025
// feature

src/main/java/gitflow/GitflowBranchUtil.java

+23-18
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,38 @@ public GitflowBranchUtil(Project project, GitRepository repo){
4141
myRepo = repo;
4242

4343
if (repo != null) {
44-
currentBranchName = GitBranchUtil.getBranchNameOrRev(repo);
45-
46-
GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(project, repo);
47-
branchnameMaster = gitflowConfigUtil.masterBranch;
48-
branchnameDevelop = gitflowConfigUtil.developBranch;
49-
prefixFeature = gitflowConfigUtil.featurePrefix;
50-
prefixRelease = gitflowConfigUtil.releasePrefix;
51-
prefixHotfix = gitflowConfigUtil.hotfixPrefix;
52-
prefixBugfix = gitflowConfigUtil.bugfixPrefix;
53-
54-
initRemoteBranches();
55-
initLocalBranchNames();
44+
update();
5645
}
5746
}
5847

48+
public void update(){
49+
currentBranchName = GitBranchUtil.getBranchNameOrRev(myRepo);
50+
51+
GitflowConfigUtil gitflowConfigUtil = GitflowConfigUtil.getInstance(myProject, myRepo);
52+
gitflowConfigUtil.update();
53+
branchnameMaster = gitflowConfigUtil.masterBranch;
54+
branchnameDevelop = gitflowConfigUtil.developBranch;
55+
prefixFeature = gitflowConfigUtil.featurePrefix;
56+
prefixRelease = gitflowConfigUtil.releasePrefix;
57+
prefixHotfix = gitflowConfigUtil.hotfixPrefix;
58+
prefixBugfix = gitflowConfigUtil.bugfixPrefix;
59+
60+
initRemoteBranches();
61+
initLocalBranchNames();
62+
}
63+
5964
public String getCurrentBranchName() {
6065
return currentBranchName;
6166
}
6267

6368
public boolean hasGitflow(){
6469
boolean hasGitflow = myRepo != null
65-
&& branchnameMaster != null
66-
&& branchnameDevelop != null
67-
&& prefixFeature != null
68-
&& prefixRelease != null
69-
&& prefixHotfix != null
70-
&& prefixBugfix != null;
70+
&& getBranchnameMaster() != null
71+
&& getBranchnameDevelop() != null
72+
&& getPrefixFeature() != null
73+
&& getPrefixRelease() != null
74+
&& getPrefixHotfix() != null
75+
&& getPrefixBugfix() != null;
7176

7277
return hasGitflow;
7378
}

src/main/java/gitflow/GitflowBranchUtilManager.java

+17-20
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ public class GitflowBranchUtilManager {
2626
private static HashMap<GitRepository, GitflowBranchUtil> repoBranchUtilMap;
2727

2828
static public GitflowBranchUtil getBranchUtil(GitRepository repo){
29-
return repoBranchUtilMap.get(repo);
29+
if (repoBranchUtilMap != null) {
30+
return repoBranchUtilMap.get(repo);
31+
} else {
32+
return null;
33+
}
3034
}
3135

3236
static public void setupBranchUtil(Project project, GitRepository repo){
@@ -38,24 +42,17 @@ static public void setupBranchUtil(Project project, GitRepository repo){
3842
* Repopulates the branchUtils for each repo
3943
* @param project
4044
*/
41-
static public Future<Void> update(Project proj){
42-
final Project project = proj;
43-
return (Future<Void>) ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
44-
@Override
45-
public void run() {
46-
if (repoBranchUtilMap == null){
47-
repoBranchUtilMap = new HashMap<GitRepository, gitflow.GitflowBranchUtil>();
48-
}
49-
50-
List<GitRepository> gitRepositories = GitUtil.getRepositoryManager(project).getRepositories();
51-
52-
Iterator gitRepositoriesIterator = gitRepositories.iterator();
53-
while(gitRepositoriesIterator.hasNext()){
54-
GitRepository repo = (GitRepository) gitRepositoriesIterator.next();
55-
GitflowBranchUtilManager.setupBranchUtil(project, repo);
56-
}
57-
}
58-
});
59-
45+
static public void update(Project proj){
46+
if (repoBranchUtilMap == null){
47+
repoBranchUtilMap = new HashMap<GitRepository, gitflow.GitflowBranchUtil>();
48+
}
49+
50+
List<GitRepository> gitRepositories = GitUtil.getRepositoryManager(proj).getRepositories();
51+
52+
Iterator gitRepositoriesIterator = gitRepositories.iterator();
53+
while(gitRepositoriesIterator.hasNext()){
54+
GitRepository repo = (GitRepository) gitRepositoriesIterator.next();
55+
GitflowBranchUtilManager.setupBranchUtil(proj, repo);
56+
}
6057
}
6158
}

src/main/java/gitflow/GitflowConfigUtil.java

+29-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package gitflow;
22

3+
import java.util.concurrent.ExecutionException;
4+
import java.util.concurrent.Future;
5+
import com.intellij.openapi.application.ApplicationManager;
36
import com.intellij.openapi.project.Project;
47
import com.intellij.openapi.vcs.VcsException;
58
import com.intellij.openapi.vfs.VirtualFile;
@@ -60,20 +63,35 @@ public static GitflowConfigUtil getInstance(Project project_, GitRepository repo
6063
project = project_;
6164
repo = repo_;
6265

66+
update();
67+
}
68+
69+
public void update(){
6370
VirtualFile root = repo.getRoot();
6471

6572
try{
66-
masterBranch = GitConfigUtil.getValue(project, root, BRANCH_MASTER);
67-
developBranch = GitConfigUtil.getValue(project, root, BRANCH_DEVELOP);
68-
featurePrefix = GitConfigUtil.getValue(project,root,PREFIX_FEATURE);
69-
releasePrefix = GitConfigUtil.getValue(project,root,PREFIX_RELEASE);
70-
hotfixPrefix = GitConfigUtil.getValue(project,root,PREFIX_HOTFIX);
71-
bugfixPrefix = GitConfigUtil.getValue(project,root,PREFIX_BUGFIX);
72-
supportPrefix = GitConfigUtil.getValue(project,root,PREFIX_SUPPORT);
73-
versiontagPrefix = GitConfigUtil.getValue(project,root,PREFIX_VERSIONTAG);
74-
75-
} catch (VcsException e) {
76-
NotifyUtil.notifyError(project, "Config error", e);
73+
Future<Void> f = (Future<Void>) ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
74+
@Override
75+
public void run() {
76+
try{
77+
masterBranch = GitConfigUtil.getValue(project, root, BRANCH_MASTER);
78+
developBranch = GitConfigUtil.getValue(project, root, BRANCH_DEVELOP);
79+
featurePrefix = GitConfigUtil.getValue(project,root,PREFIX_FEATURE);
80+
releasePrefix = GitConfigUtil.getValue(project,root,PREFIX_RELEASE);
81+
hotfixPrefix = GitConfigUtil.getValue(project,root,PREFIX_HOTFIX);
82+
bugfixPrefix = GitConfigUtil.getValue(project,root,PREFIX_BUGFIX);
83+
supportPrefix = GitConfigUtil.getValue(project,root,PREFIX_SUPPORT);
84+
versiontagPrefix = GitConfigUtil.getValue(project,root,PREFIX_VERSIONTAG);
85+
} catch (VcsException e) {
86+
NotifyUtil.notifyError(project, "Config error", e);
87+
}
88+
}});
89+
f.get();
90+
91+
} catch (InterruptedException e) {
92+
e.printStackTrace();
93+
} catch (ExecutionException e) {
94+
e.printStackTrace();
7795
}
7896
}
7997

0 commit comments

Comments
 (0)