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
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: James Mcgee
date: 2017-06-14 12:29:49.000000000

Uploaded patch set 19.

-------------------------------------
author: Brenden Conley
date: 2017-06-14 12:29:55.000000000

Patch Set 19:

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

-------------------------------------
author: Brenden Conley
date: 2017-06-14 12:53:38.000000000

Patch Set 19: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/9933/ : SUCCESS

-------------------------------------
author: James Mcgee
date: 2017-06-15 08:23:57.000000000

Patch Set 19:

(17 comments)

-------------------------------------
author: Alayna Houston
date: 2017-06-15 09:43:42.000000000

Patch Set 19:

> Can you think of more test cases, that we should add?

Looks like we have no tests for ICommitMessageProvider2 instances returning nonsense values (-300, or > length of message). There should also be a test that tests for desiredPosition == length of message. Could be non-UI tests.

 > With max one CommitMessageProvider, configurable for SWTBot tests,
 > we can't have many combinations.

Well, we could extend that TestCommitMessageProviderExtensionFactory.INSTANCE to accept a list of providers, returning them in sequence, and then add a second <commitMessageProvider> element in fragment.xml. There should be at least on test that multiple providers within the same <extension> element work. (The cardinality in commitMessageProvider.exsd was changed in patch set 11.) The test would need to verify the position (only first one taken) and that the final full commit message does include the text from both providers.

 > And the more complex test cases are already implemented without SWTBot.

Right. Except the cardinality test for <commitMessageProvider>.

-------------------------------------
author: James Mcgee
date: 2017-06-15 13:00:35.000000000

Patch Set 19:

> > Can you think of more test cases, that we should add?
 > 
 > Looks like we have no tests for ICommitMessageProvider2 instances
 > returning nonsense values (-300, or > length of message). There
 > should also be a test that tests for desiredPosition == length of
 > message. Could be non-UI tests.
 > 

Done

 > > With max one CommitMessageProvider, configurable for SWTBot
 > tests,
 > > we can't have many combinations.
 > 
 > Well, we could extend that TestCommitMessageProviderExtensionFactory.INSTANCE
 > to accept a list of providers, returning them in sequence, and then
 > add a second <commitMessageProvider> element in fragment.xml. There
 > should be at least on test that multiple providers within the same
 > <extension> element work. (The cardinality in commitMessageProvider.exsd
 > was changed in patch set 11.) The test would need to verify the
 > position (only first one taken) and that the final full commit
 > message does include the text from both providers.
 > 

INSTANCE does not yet accept a list.
Just wanted to know, if I added the second provider within the same <extension> element according to your idea.

 > > And the more complex test cases are already implemented without
 > SWTBot.
 > 
 > Right. Except the cardinality test for <commitMessageProvider>.

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