DESCRIPTION

Add ICommitMessageProvider2 for caret positioning in commit messages

The caret in the CommitMessageComponent is placed according to the
value of getDesiredCaretPosition() of the first implementation of
ICommitMessageProvider2 that provides caret position. In case there
are multiple implementations available that provide a defined caret
position the second and subsequent positions are ignored.

Commit messages are not trimmed anymore to ensure consistency between
a provided message and the provided caret position.

Includes unit and UI tests.

Bug: 516867
Change-Id: I1b0ffd33ef37196d53077d09774672c2b033835f
Signed-off-by: James Mcgee xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2017-06-13 12:07:53.000000000

Uploaded patch set 14.

-------------------------------------
author: Brenden Conley
date: 2017-06-13 12:07:59.000000000

Patch Set 14:

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

-------------------------------------
author: Alayna Houston
date: 2017-06-13 12:19:33.000000000

Patch Set 14:

There is no need to add a new test bundle just for that extension point. I've removed the new bundle and moved the extension point over to the test fragment itself.

I've re-written the TestCommitMessageProviderExtensionFactory to be a real IExecutableExtensionFactory, moved the new UI test over to package ...stagview, and introduced a new abstract super class for the StagingViewTest and the new CommitMessageComponentTest.

Finally I've simplified StagingViewTester.getCaretPosition().

I guess with that head-start you could add more UI tests? Like, extend this such that one can set several providers on TestCommitMessageFactory.INSTANCE, which would then be returned in sequence, and then add a second extension to be able to test that only the first position returned is indeed taken.

Locally, the tests succeed. Now let's see what Hudson means...

-------------------------------------
author: Alayna Houston
date: 2017-06-13 12:22:05.000000000

Patch Set 14:

BTW, sorry for jumping in on this change. I found it easier to show what I meant than trying to explain it. Hope you don't mind. If you continue building on this, do a "Fetch from Gerrit" first and then continue on that.

-------------------------------------
author: Alayna Houston
date: 2017-06-13 12:28:56.000000000

Patch Set 14:

(1 comment)

Line:32, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/CommitMessageComponentTest.java -> Copy-paste error. Should be "testCaretPosition", of course.

-------------------------------------
author: Brenden Conley
date: 2017-06-13 12:49:54.000000000

Patch Set 14: Verified-1

Build Failed 

https://hudson.eclipse.org/egit/job/egit.gerrit/9921/ : ABORTED

-------------------------------------
author: Alayna Houston
date: 2017-06-13 14:46:36.000000000

Patch Set 14:

(1 comment)

Line:32, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/CommitMessageComponentTest.java -> Done

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