DESCRIPTION

Add ICommitMessageProvider2 for caret positioning in commit messages

The caret in the CommitMessageComponent is placed, according to the
value of getCaretPosition() of the first implementation of
ICommitMessageProvider2, that was discovered. In case there are multiple
implementations available, they are ignored.
Commit messages are not trimmed anymore, to ensure consistency between a
provided message and the provided caret position.

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

COMMENTS

author: James Mcgee
date: 2017-06-07 06:32:21.000000000

Uploaded patch set 7.

-------------------------------------
author: Brenden Conley
date: 2017-06-07 06:32:27.000000000

Patch Set 7:

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

-------------------------------------
author: Brenden Conley
date: 2017-06-07 06:57:53.000000000

Patch Set 7: Verified+1

Build Successful 

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

-------------------------------------
author: Alayna Houston
date: 2017-06-07 11:03:29.000000000

Patch Set 7:

(3 comments)

Line:73, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageCalculator.java -> Partial sentence.

Line:153, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageCalculator.java -> Independent of whether we use 0 or -1 as default position, we must validate the messageWithPosition.getDesiredCaretPosition() here. What if it is -300?? Or the message has 100 characters, but the position is 3000? ICommitMessageProviders are untrusted code; they may or may not return sensible things. EGit must not fail or wreck havoc when there is a misbehaving ICommitMessageProvider.

-------------------------------------
author: James Mcgee
date: 2017-06-08 06:54:11.000000000

Patch Set 7:

(5 comments)

The CommitMessageCalculator internally distinguishes between undefined (-1) and defined (>= 0) caret positions, but always returns a defined caret position in the value object.

I introduced a constant CARET_DEFAULT_POSITION. Is it ok to put it in CommitMessageComponentState?

Line:73, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageCalculator.java -> Done

Line:153, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageCalculator.java -> Done

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