DESCRIPTION

Extend EGit to allow use of git-flow

Initial implementation:
- Operations for all commonly used git flow commands without optional
  parameters
- Menu contributions in the repository and history view, as well as the
  team menu on projects
- Added new feature as incubation project to update site
- Non-UI tests (see launch config)

Bug: 348610
Change-Id: I215ed28e6434a789fa7260d7072532b402a1e714
Signed-off-by: Jamarion Hunt xxx@xxx.xxx


COMMENTS

author: Jamarion Hunt
date: 2015-04-30 10:20:11.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-04-30 10:20:18.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/6962/

-------------------------------------
author: Brenden Conley
date: 2015-04-30 10:37:53.000000000

Patch Set 1: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/6962/ : UNSTABLE

-------------------------------------
author: Douglas Trujillo
date: 2015-05-04 13:02:30.000000000

Patch Set 1: Code-Review-1

(86 comments)

Do you plan support for gitflow on jgit command line level (org.eclipse.jgit.pgm) ?
Then some of the basic stuff should go into jgit.

- non-test plugins need to contain about.html, copy from another already existing plugin
- copy .settings from another similar egit plugin (tests have different settings)

.project files: 
- we don't use org.eclipse.m2e.core.maven2Builder since m2e tends to eat CPU 
and try to download the internet at random times
- we use org.eclipse.pde.api.tools.apiAnalysisBuilder for non-test bundles to check for API changes

- new API should be annotated xxx@xxx.xxx 4.0 tag

- operations which touch files in the workspace should lock on repository level
using RuleUtils and run in a WorkspaceJob to prevent premature UI refreshes by
emitting events too early

Line:1, org.eclipse.egit.gitflow.ui/plugin.properties -> I would rather start with the verb

 Init Git Flow
or
 Initialize Git Flow

Line:1, org.eclipse.egit.gitflow.ui/plugin.properties -> we don't try to align '=' in properties files

Line:45, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java -> better use WorkspaceJob to prevent refresh is triggered prematurely (see commit 786698088)

Line:61, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java -> lock on repository level since this operation may touch workspace files

Line:18, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/NameValidator.java -> style nit: unnecessary blank line

Line:20, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/NameValidator.java -> it's validating branches so it should better be named

 BranchNameValidator

Line:2, org.eclipse.egit.gitflow.test/pom.xml -> style nit: trailing whitespace

Line:10, org.eclipse.egit.gitflow.test/META-INF/MANIFEST.MF -> use versioned package imports instead

Line:45, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> git path separator ?

Line:63, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> only the operations touching files in the working tree should lock resources

Line:122, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> which code will catch this and present a dialog to the user ?

Line:157, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> which code will catch this and present a dialog to the user ?

Line:44, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java -> add this bundle to the x-friends of egit.core to get rid of these warnings

Line:1, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java -> missing license header

Line:25, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java -> this raises an error "Unnecessary cast from Repository to Repository" on Mars, use Utils.getAdapter() to fix this

Line:32, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureFinishOperationTest.java -> why all these blank lines ?

Line:28, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/AllTests.java -> we stopped using explicit test suites to prevent that we miss to add new tests to a test suite explicitly

Line:23, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperationTest.java -> don't suppress these warnings but instead add this test bundle to the x-friends of the egit bundles it wants to use (in their manifest.mf)

Line:70, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/InitOperation.java -> style nit: trailing whitespace

Line:20, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureCheckoutOperationTest.java -> don't suppress these warnings but instead add this test bundle to the x-friends of the egit bundles it wants to use (in their manifest.mf)

Line:9, org.eclipse.egit.gitflow/META-INF/MANIFEST.MF -> use versioned package dependencies instead

Line:13, org.eclipse.egit.gitflow/META-INF/MANIFEST.MF -> version exported packages [4.0,4.1)

Line:62, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractGitFlowOperationTest.java -> use base class AnyObjectId as parameter type

Line:62, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractGitFlowOperationTest.java -> this doesn't find a commit but parse it, so maybe better "parseCommit" ?

Line:62, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractGitFlowOperationTest.java -> why head ? can be used for any commit

Line:33, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java -> what is $NAME ?

Line:58, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java -> if this touches workspace files lock on repository level and use WorkspaceJob

Line:24, org.eclipse.egit.gitflow.ui/.project -> remove maven builder and nature

Line:7, org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF -> use versioned package dependencies instead, see the other egit bundles, we use ./tools/version.sh to flip the version numbers of jgit and egit package dependencies, this ensures that users can't mix egit bundle versions, e.g. egit.core 3.6 can't be installed with egit.ui 3.7

Line:30, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/HotfixStartOperationTest.java -> style nit: remove this blank line

Line:24, org.eclipse.egit.gitflow.test/.project -> remove the maven builder and nature

Line:2, org.eclipse.egit.gitflow-feature/.gitignore -> why two entries for the target folder ? 
looks like the latter would be sufficient

Line:294, pom.xml -> style nit: trailing whitespace

Line:24, org.eclipse.egit.gitflow/.project -> remove maven builder and nature

Line:36, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/ReleaseFinishOperationTest.java -> style nit: surrounding every statement with blank lines seems waste of space

Line:87, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/ReleaseFinishOperationTest.java -> you could use instead

xxx@xxx.xxx = WrongGitFlowStateException.class)

Line:114, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/ReleaseFinishOperationTest.java xxx@xxx.xxx = CoreException.class)

Line:25, org.eclipse.egit.gitflow-feature/feature.xml -> this feature should declare dependencies that need to be present before this feature can be installed, at least org.eclipse.jgit, org.eclipse.egit.core and org.eclipse.egit.ui are required

Line:60, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java -> TagOperation.execute() and RefUpdate which it is using will fail if the tag already exists, points at a different commit and the force flag isn't set

Line:72, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java -> use Java 7 multi-catch instead of repeating the same code 3 times

Line:1, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/selection/SelectionPropertyTester.java -> missing license header

Line:31, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/Activator.java -> style nit: remove trailing whitespace

Line:33, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/Activator.java -> we don't xxx@xxx.xxx tags on overridden methods

Line:114, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/HotfixFinishOperationTest.java -> style nit: unnecessary blank line

Line:1, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractSelectionDialog.java -> missing license header

Line:34, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractSelectionDialog.java -> maybe add Gitflow to the class name to distinguish it from the AbstractSelectionDialog in org.eclipse.jface.dialogs

Line:143, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractSelectionDialog.java -> missing braces

Line:47, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureRebaseHandler.java -> better use a WorkspaceJob to prevent premature UI refreshes

Line:78, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureRebaseHandler.java -> lock on repository level since rebase touches workspace files

Line:14, org.eclipse.egit.gitflow-feature/.project -> we avoid to use maven builder since it tends to eat CPU and download the internet at random times

Line:13, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/internal/coretext.properties -> use parameters instead of trailing whitespace, languages differ in grammar so ordering of words can vary

Line:30, org.eclipse.egit.repository/category.xml -> s/4.0.0/0.0.0/ to keep the number of sources we have to update for a version bump minimal

Line:17, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/HotfixNameValidator.java -> style nit: unnecessary blank line

Line:23, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/HotfixNameValidator.java -> cryptic name

Line:1, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowDefaults.java -> missing license header

Line:96, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureListOperation.java -> feature branches

Line:27, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> style nit: trailing whitespace

Line:29, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> we don't xxx@xxx.xxx tags on overridden methods

Line:83, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> style nit: trailing whitespace

Line:88, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> unnecessary whitespace

Line:107, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> incorrect since tag

Line:114, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> missing braces

Line:11, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractFeatureOperationTest.java -> why is this empty class needed ?

Line:31, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java -> what is this ?

Line:42, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java -> on Mars this leads to an "unnecessary cast to Repository" error.

Use Utils.getAdapter() to fix this. See commit 47cbc54b48f

Line:41, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractDualRepositoryTestCase.java -> don't suppress these warnings but instead add this test bundle to the x-friends of the egit bundles it wants to use (in their manifest.mf)

Line:111, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractDualRepositoryTestCase.java -> you handle all these exceptions in the same way so you can use multi-catch:

 } catch (RevisionSyntaxException | AmbiguousObjectException | IncorrectObjectTypeException | IOException e) {

Line:123, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractDualRepositoryTestCase.java -> s/getRemote/getRemoteName/

Line:130, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractDualRepositoryTestCase.java -> try to find a more descriptive method name e.g.: "getBranchToMerge" or "getUpstreamBranchName"

Line:86, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/BranchNameValidator.java -> use Repository.isValidRefName(final String refName) to check if a given name is a valid branch name

Line:90, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/BranchNameValidator.java -> so gitflow doesn't allow hierarchical branch names ?

Line:1, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> missing license header

Line:38, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> maybe it makes sense to extract parsing gitflow configuration into a separate class similar to RemoteConfig

Line:133, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> s/branchs/branch/

Line:141, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> name "develop"

Line:149, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> name "master"

Line:7, org.eclipse.egit.gitflow.ui/plugin.xml -> there's no obvious relationship between git-flow and the "Show In" submenu, hence I propose to put gitflow menu in its own group and separate it from the other commands with a separator

File Comment: org.eclipse.egit.ui.importer/.settings/org.eclipse.jdt.core.prefs -> remove this unrelated change

Line:56, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureRebaseOperation.java -> use multi-catch ?

Line:50, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperation.java -> what will happen if multiple remotes exist ?

there's no explicit refspec ?

Line:6, org.eclipse.egit.gitflow.test/.classpath -> good idea we should do the same for the other plugins to allow reusing class files between eclipse compiler and maven build

Line:15, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/WrongGitFlowStateException.java -> maybe better extend IllegalStateException ?

Line:73, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java -> checkout can potentially run a long time when executed on a large repository

Could you use BranchOperationUI which runs checkout in a workspaceJob to run the checkout in the background and prevent premature UI refreshes (see commit 786698088)

Line:101, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java -> checkout should lock on repository level using RuleUtil.getRule(Repository) since it's touching files in the workspace

Line:56, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java -> what if there's no HEAD (empty repository)

Line:81, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java -> what if the commit is null ?

-------------------------------------
author: Jamarion Hunt
date: 2015-05-07 22:25:44.000000000

Patch Set 1:

(73 comments)

Thanks for your feedback. I learned a few new things, going through your comments.
I created a second patch-set, fixing the simple issues, which fortunately seems to be the major part.
I will create a third patch-set, including the changes that require a bit more refactoring, etc.
I hope that will make reviewing easier as well.

> Do you plan support for gitflow on jgit command line level ?
No. I think there is a jar file from Atlassian somewhere that does that. The advantage of re-using EGit operations is that they take care of most of the hard work, such as resource locking, project closing etc., which makes Eclipse integration a lot easier.

> non-test plugins need to contain about.html, copy from another already existing plugin
I will do that for the following patch-set.

> copy .settings from another similar egit plugin (tests have different settings)
I already did that. If something is missing, please let me know.

> we don't use org.eclipse.m2e.core.maven2Builder since m2e tends to eat CPU and try to download the internet at random times
Interesting. Is there a bug that describes the problem?

> we use org.eclipse.pde.api.tools.apiAnalysisBuilder for non-test bundles to check for API changes
> new API should be annotated xxx@xxx.xxx 4.0 tag
> operations which touch files in the workspace should lock on repository level using RuleUtils and run in a WorkspaceJob to prevent premature UI refreshes by emitting events too early
I will try to change that in the following patch-set.

Line:1, org.eclipse.egit.gitflow.ui/plugin.properties -> Done

Line:1, org.eclipse.egit.gitflow.ui/plugin.properties -> In the beginning I tried to label the operations according to their CLI equivalent, e.g. "$ git flow init", but I have to admit the current state is not consistent because it should also be "[...] feature start" instead of "Start Feature".

Line:45, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureFinishHandler.java -> Done. Also for Hotfix and ReleaseFinishHandler.

Line:18, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/NameValidator.java -> Done

Line:20, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/NameValidator.java -> Done. There already is a BranchNameValidator.

Line:2, org.eclipse.egit.gitflow.test/pom.xml -> Done

Line:10, org.eclipse.egit.gitflow.test/META-INF/MANIFEST.MF -> Done

Line:45, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> Done

Line:122, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> I assume the WorkbenchErrorHandler will show a generic error dialog. I don't know, how I can improve on that in this case.

Line:157, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> See comment above.

Line:44, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureTrackHandler.java -> Unfortunately I need org.eclipse.egit.ui.internal.selection

Line:1, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/factories/GitFlowAdapterFactory.java -> Done

Line:32, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureFinishOperationTest.java -> Done

Line:28, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/AllTests.java -> Done

Line:23, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperationTest.java -> Done

Line:70, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/InitOperation.java -> Done

Line:20, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/FeatureCheckoutOperationTest.java -> Done

Line:9, org.eclipse.egit.gitflow/META-INF/MANIFEST.MF -> Done

Line:13, org.eclipse.egit.gitflow/META-INF/MANIFEST.MF -> 4.0.0?

Line:62, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractGitFlowOperationTest.java -> Done

Line:62, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractGitFlowOperationTest.java -> Done

Line:62, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractGitFlowOperationTest.java -> Done

Line:33, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java -> The name of the feature. I realize now that my JavaDoc requires some knowledge of the git flow CLI.

Line:58, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureStartHandler.java -> Done

Line:24, org.eclipse.egit.gitflow.ui/.project -> Done

Line:7, org.eclipse.egit.gitflow.ui/META-INF/MANIFEST.MF -> I am using imports w/o versions for git flow packages, and imports with versions for all other egit packages.
For eclipse I use versioned requires.
Is that ok?

Line:30, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/HotfixStartOperationTest.java -> Done

Line:24, org.eclipse.egit.gitflow.test/.project -> Done

Line:2, org.eclipse.egit.gitflow-feature/.gitignore -> Done

Line:294, pom.xml -> Done

Line:305, pom.xml -> This shouldn't have been committed.
I removed those bundles from the build because they were not compiling in the commit that I forked the repository.

Line:24, org.eclipse.egit.gitflow/.project -> Done

Line:36, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/ReleaseFinishOperationTest.java -> Done

Line:87, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/ReleaseFinishOperationTest.java -> I decided not to use annotations because EclEmma will then show the complete method as not executed, but so far I was not very consequent with that.
If you prefer the annotations in EGit, I'll change it.

Line:114, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/ReleaseFinishOperationTest.java -> See above comment.

Line:25, org.eclipse.egit.gitflow-feature/feature.xml -> Done

Line:60, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java -> That means I could catch and handle the TeamException.
Unfortunately, a TeamException does not always mean that the tag already exists, which I think is an important distinction here because it likely means that the same git flow operation was started before (and maybe failed).

Line:72, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/AbstractVersionFinishOperation.java -> Done

Line:1, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/selection/SelectionPropertyTester.java -> Done

Line:31, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/Activator.java -> Done

Line:33, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/Activator.java -> Done

Line:114, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/HotfixFinishOperationTest.java -> Done

Line:1, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractSelectionDialog.java -> Done

Line:34, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractSelectionDialog.java -> Done

Line:143, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/dialog/AbstractSelectionDialog.java -> Done

Line:14, org.eclipse.egit.gitflow-feature/.project -> Done

Line:30, org.eclipse.egit.repository/category.xml -> Done

Line:17, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/HotfixNameValidator.java -> Done

Line:23, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/validation/HotfixNameValidator.java -> Done

Line:1, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowDefaults.java -> Done

Line:96, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureListOperation.java -> Done

Line:27, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> Done

Line:29, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> Done

Line:83, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> Done

Line:88, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> Done

Line:107, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> Done

Line:114, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/Activator.java -> Done

Line:11, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractFeatureOperationTest.java -> It was intended to hold some otherwise redundant code, but I forgot to refactor it.

Line:31, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java -> Done

Line:41, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractDualRepositoryTestCase.java -> Done

Line:111, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractDualRepositoryTestCase.java -> Done

Line:123, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractDualRepositoryTestCase.java -> Done

Line:130, org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/op/AbstractDualRepositoryTestCase.java -> I renamed it, and moved it to GitFlowRepository.

Line:86, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/BranchNameValidator.java -> Done

Line:90, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/BranchNameValidator.java -> Done
Apparently it does.

Line:1, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> Done

Line:133, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> Done

Line:141, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> Done

Line:149, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/GitFlowRepository.java -> Done

Line:7, org.eclipse.egit.gitflow.ui/plugin.xml -> Done

File Comment: org.eclipse.egit.ui.importer/.settings/org.eclipse.jdt.core.prefs -> whoops...
Done

Line:56, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/FeatureRebaseOperation.java -> Done

Line:6, org.eclipse.egit.gitflow.test/.classpath -> I believe this was set by m2e.

-------------------------------------
author: Jamarion Hunt
date: 2015-05-11 10:56:03.000000000

Patch Set 1:

(6 comments)

I think I fixed most of the issues. For some others I added TODOs.
Let me know, if there is something else missing!

Line:63, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> Is there something here that I need to change?
Currently only the JobUtils are calling this method.

Line:42, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/AbstractPublishHandler.java -> It seems I'm working with an outdated milestone release of Mars. Let me update my environment first.

Line:50, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/CurrentBranchPublishOperation.java -> I see you point, but I'm unsure how to properly check for that, and what to do in this case.
However, I think it's not a typical git flow scenario, hence this i not very urgent IMO.

Line:73, org.eclipse.egit.gitflow.ui/src/org/eclipse/egit/gitflow/ui/internal/actions/FeatureCheckoutHandler.java -> Done

Line:56, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java -> Done
According to the doc Repository#resolve(String) will throw a MissingObjectException.
I decided to wrap it into a WrongGitFlowStateException because an empty repository is not something you would normally operate on with git flow.

Line:81, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/ReleaseStartOperation.java -> Done
I decide to throw an IllegalStateException.

-------------------------------------
author: Douglas Trujillo
date: 2015-05-11 12:59:21.000000000

Patch Set 1:

(1 comment)

Line:63, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> there are a lot of gitflow operations inheriting from this abstract class, if some of them don't touch the working tree (modify files in the working tree) there's no need to lock any resources, this reduces the chance that another unrelated job has to wait until the gitflow job finished

-------------------------------------
author: Jamarion Hunt
date: 2015-05-12 09:23:30.000000000

Patch Set 1:

(1 comment)

Line:63, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> I see. But the doc says "It can also be useful to use a rule for reading resources to avoid changes on the resources by other threads while the operation is running."
So wouldn't it be necessary for read-only operations as well?

I have now overridden getSchedulingRule() in two sub-classes with: RuleUtil.getRuleForContainers(Collections.<IPath> emptySet())
But I am unsure if that is correct. Shouldn't I lock on the git-config? Is that even possible?

Most EGit operations seem to lock on an least one repository. Some lock on a list of resources, but I don't think that applies on any git flow operations. They either, at least checkout branches, or, perform operations on the remote, which either reads or read/writes the git config.

-------------------------------------
author: Douglas Trujillo
date: 2015-05-12 12:29:09.000000000

Patch Set 1:

(1 comment)

Line:63, org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow/op/GitFlowOperation.java -> Not sure about the read-only case, I have in mind we only use lock operations modifying the working tree. Using the right scheduling rule is especially important for jobs modifying files since otherwise a concurrently started build job would have to be cancelled potentially multiple times which can eat a lot of valuable time.

I think you can't lock git config using resource API since JGit doesn't know about it. JGit and EGit don't cache configuration in memory and JGit uses org.eclipse.jgit.internal.storage.file.FileSnapshot to avoid unnecessy re-reading the same configuration.

-------------------------------------
