DESCRIPTION

Support hyperlink detector for Commit ids

In order to have better navigation between code and tasks, this
hyperlink detector recognizes commit ids inside the task descriptions
and let's the user open the corresponding commit in the Commit editor.

Change-Id: Ic60d11a45b8cb8cc9383e4120a84eae2f1859e32
Signed-off-by: Marley Hopkins xxx@xxx.xxx


COMMENTS

author: Marley Hopkins
date: 2011-08-11 22:17:43.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2011-08-11 22:17:47.000000000

Patch Set 3:

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

-------------------------------------
author: Marley Hopkins
date: 2011-08-11 22:18:04.000000000

Patch Set 3:

Rebased

-------------------------------------
author: Brenden Conley
date: 2011-08-11 22:29:11.000000000

Patch Set 3: Build Successful

Build Successful 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/1407/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2011-08-13 23:56:18.000000000

Patch Set 3: I would prefer that you didn't submit this

(9 inline comments)

nice idea

I tried running the tests on Mac OS X and they are failing from both Eclipse and maven build, here the error log from maven build:


 T E S T S
-------------------------------------------------------
Running org.eclipse.egit.internal.mylyn.AllMylynTests
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.01 sec <<< FAILURE!
initializationError(org.eclipse.egit.internal.mylyn.AllMylynTests)  Time elapsed: 0.002 sec  <<< ERROR!
java.lang.Exception: No runnable methods
	at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:154)
	at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:112)
	at org.junit.runners.ParentRunner.validate(ParentRunner.java:253)
	at org.junit.runners.ParentRunner.<init>(ParentRunner.java:55)
	at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:56)
	at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:13)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
	at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>(JUnit4TestSet.java:45)
	at org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet(JUnit4DirectoryTestSuite.java:56)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:96)
	at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:209)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:156)
...

Line:4, org.eclipse.egit.mylyn.ui.test/.settings/org.eclipse.jdt.core.prefs -> we still support Java 1.5

I would recommend to copy all prefs from an already existing project (e.g. egit.ui.tests) to ensure consistent settings

resources.prefs and runtime.prefs are required to enforce UTF-8 encoded source encoding and unix line endings

Line:7, org.eclipse.egit.mylyn.ui.test/META-INF/MANIFEST.MF -> should be JavaSE-1.5

Line:3, org.eclipse.egit.mylyn.ui.test/.classpath -> so far we still support JavaSE-1.5

Line:140, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java -> missing javadoc

Line:144, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java -> style nit: no braces around single line blocks

Line:169, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java -> Should we also look for abbreviated commitIDs if they have a reasonable minimum length 
and can be resolved non-ambiguously, similar to what cgit also allows on the command line ? 
see AbbreviatedObjectId.isId()

Line:204, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java -> style nit: no braces here

Line:22, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/Messages.java -> style nit: in similar classes we use a single blank instead of a tab between /** and */

Line:26, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/Messages.java -> style nit: how about adding a blank line before the static initializer to increase readability ?

-------------------------------------
author: Marley Hopkins
date: 2011-08-16 23:57:20.000000000

Patch Set 3: (9 inline comments)

Just rebased and fixed minor nits. Tests are working for me from the IDE and with a mvn clean install.

Line:4, org.eclipse.egit.mylyn.ui.test/.settings/org.eclipse.jdt.core.prefs -> Done

Line:7, org.eclipse.egit.mylyn.ui.test/META-INF/MANIFEST.MF -> Done

Line:3, org.eclipse.egit.mylyn.ui.test/.classpath -> Done

Line:140, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java -> Done

Line:144, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java -> Done

Line:169, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java -> I'd say we should no try to do this as the minimum length depends on the repository and we may end up parsing really everything in the incoming source viewer instead of failing earlier as we now do.

Line:204, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java -> Done

Line:22, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/Messages.java -> Done

Line:26, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/Messages.java -> Done

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