DESCRIPTION

Support multiple ICommitMessageProvider implementations

In case, that multiple implementations of ICommitMessageProvider
are available in Eclipse, the commit messages of all providers
are concatenated and provided in the CommitMessageComponent.

Bug: 376388
Change-Id: I34975b91b45718b54f9bbe4fe2a1d125871ba5e7
Signed-off-by: James Mcgee xxx@xxx.xxx


COMMENTS

author: James Mcgee
date: 2017-05-10 08:19:21.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2017-05-10 08:19:26.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2017-05-10 08:41:56.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Alayna Houston
date: 2017-05-10 08:56:14.000000000

Patch Set 1: Code-Review-1

(9 comments)

Good idea, but needs a little more work.

Line:676, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Should become a StringBuilder now, at the end return builder.toString().

Line:691, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Now that loading the message providers has changed, you can rely on there not being a null element in the list, so this check here is not needed.

Line:693, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Now that we loop this should be done once outside of the loop.

Line:695, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Is that really necessary? I think just using '\n' should be good enough. Also for Windows.

Also, would it make sense to enforce one empty line between multiple messages? (I.e., add two '\n's.)

Line:697, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> I think we should be more careful here. After all we're calling untrusted external code.

Check for messageProvider returning null before trimming, and if the provided message is null or empty after trimming, don't modify calculatedCommitMessage.

Line:707, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Should be renamed: plural, i.e., getCommitMessageProviders.

Line:712, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Plural: configs.

Line:714, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Why not

  for (IConfigurationElement config : configs) { ... }

?

Line:716, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Now that we're loading several extensions, I think we should catch CoreException and InvalidRegistryObjectException here and log them. Otherwise a single invalid extension will effectively also disable all other valid extensions.

Logging should include, if possible, the name of the contributor to aid in localizing the problem. That name can be gotten via config.getDeclaringExtension().getContributor().getName(), which itself may raise InvalidRegistryObjectException, so be  careful.

-------------------------------------
author: Alayna Houston
date: 2017-05-10 08:59:00.000000000

Patch Set 1:

(1 comment)

Line:713, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java -> Additional thought: is the order deterministic here? Or can we get the same providers in different order on successive calls? That would be confusing, the commit message might end up being "A B" once and "B A" the next time...

-------------------------------------
author: James Mcgee
date: 2017-05-10 14:02:17.000000000

Abandoned

Work is continued on the original change https://git.eclipse.org/r/#/c/9322/

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