DESCRIPTION

Provide extensibility for suggesting branch names

* Add new extension point for branch name suggestions
* Add new extension to provide branch name suggestion from Mylyn task

This change is needed to enable the automatic creation and
checkout of branches based on the active task.

Bug: 309578
Change-Id: I9e26d668617481026c81a05b6ea08b97e28f620b
AlsoBy: Charlee Mccann xxx@xxx.xxx
AlsoBy: Jade Pennington xxx@xxx.xxx
Signed-off-by: Charlee Mccann xxx@xxx.xxx
Signed-off-by: Quinten Rogers xxx@xxx.xxx

COMMENTS

author: Quinten Rogers
date: 2014-02-27 19:24:11.000000000

Uploaded patch set 10.

-------------------------------------
author: Brenden Conley
date: 2014-02-27 19:24:16.000000000

Patch Set 10:

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

-------------------------------------
author: Brenden Conley
date: 2014-02-27 19:39:11.000000000

Patch Set 10: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2014-02-27 22:06:54.000000000

Patch Set 10: Code-Review-1

(10 comments)

Line:23, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> A BranchNameProvider using description and title of the currently active task to suggest a branch name.

Line:26, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> I'd rather name this ActiveTaskBranchNameProvider since Mylyn... doesn't really describe what functionality this class provides

Line:60, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> we should ensure that the suggested branch name doesn't end with a delimiter like "_"

Line:13, org.eclipse.egit.ui/src/org/eclipse/egit/ui/IBranchNameProvider.java -> I think this first sentence doesn't add information hence I'd remove it

Line:14, org.eclipse.egit.ui/src/org/eclipse/egit/ui/IBranchNameProvider.java -> I think this is too generic, maybe better

s/provides informations related to creating branches./suggests a branch name based on current context./

Line:19, org.eclipse.egit.ui/src/org/eclipse/egit/ui/IBranchNameProvider.java -> I think the interface shouldn't disclose how you intend to use it but just provide an abstraction, hence

s/for the Creation wizard//

Line:9, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> s/provides the ability to extend the branch name suggestion./allows to register an implementation suggesting branch names based on contextual information/

Line:26, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> style nit: trailing whitespace, more below

Line:60, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> Class implementing org.eclipse.egit.ui.IBranchNameProvider to be registered for suggesting branch names

Line:75, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> this won't reach 3.3: s/3.3.0/3.4.0/

-------------------------------------
author: Carlie Harper
date: 2014-02-28 12:50:11.000000000

Patch Set 10: Code-Review-1

(1 comment)

The suggestion is only made if the new branch is based on a reference. i.e. if in CreateBranchPage myBaseCommit is null and myBaseRef != null (l. 270 in CreateBranchPage). When I create a branch on a commit in the history view where no branch or remote branch points to, therefore the suggestion is not made.

Is this the intended behavior?

Line:52, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> you should use the local variable taskKey here

-------------------------------------
author: Quinten Rogers
date: 2014-03-03 19:39:12.000000000

Patch Set 10:

(15 comments)

Your feedback is part of the next next patch set. But I have now, in addition to your review comments, some question about the content of my first extension point schema.

BTW: Thank you for giving all this feedback. I learn a lot of new, different topics about Eclipse coding from you.

Line:23, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> Done

Line:26, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> Done.
I took the MylynCommitMessageProvider class name in the same package as an example.

Line:52, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> Done

Line:60, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> What is the reason? Just more human readable or this there some source code reason?
I added a trim() which should do a good job. Do you have something more like an advanced regex in mind?

Line:13, org.eclipse.egit.ui/src/org/eclipse/egit/ui/IBranchNameProvider.java -> Done

Line:14, org.eclipse.egit.ui/src/org/eclipse/egit/ui/IBranchNameProvider.java -> Done

Line:19, org.eclipse.egit.ui/src/org/eclipse/egit/ui/IBranchNameProvider.java -> Done

Line:6, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> Compare exsd file with other exsd files.
Saw that the other sometimes use 
name="%BranchNameProviderExtension-point.name".
What is the correct variant?

Line:9, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> Done

Line:26, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> Done

Line:60, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> Done

Line:75, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> Done

Line:81, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> I compare this exsd file with others and detected that this example is mostly missing.
Can I remove it?

Line:100, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> Same default content here which is missing on other exsd files.
Can I remove it or do I have to provide information?

Line:106, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> Other exsd file have a copyright note at the end.
I guess it this needed here too, isn't it?

-------------------------------------
author: Carlie Harper
date: 2014-03-06 09:54:31.000000000

Patch Set 10:

(3 comments)

What do you mean by "Your feedback is part of the next next patch set."?

Line:6, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> When I look into the existing schemas for the platform I indeed see that the name attribute is not externalised. So it seems that our cloneSourceProvider should be changed.

Line:81, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> The platform schemas have examples. But I would not object if you deleted it.

Line:100, org.eclipse.egit.ui/schema/branchNameProvider.exsd -> I'm ok with removing it.

-------------------------------------
author: Douglas Trujillo
date: 2014-03-07 20:59:42.000000000

Patch Set 10:

(1 comment)

Line:60, org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/MylynBranchNameProvider.java -> since a branch name with trailing "_" looks ugly

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