DESCRIPTION

Extension point to hook into commit process

Functional Requirements:
- add / remove files to commit (after user had made his decision)
- ability to cancel commit although user pressed [Commit] button

To implement these requirements an extension point has been added,
named CommitObserver. CommitObservers need to implement this interface
in order to be able to take influence to a commit. Several
CommitObservers can interact.

Bug: 330327
Change-Id: I9416e74e5451488d72f15c615e3ed336676b43f7

COMMENTS

author: Jordin Monroe
date: 2011-02-26 23:53:07.000000000

Uploaded patch set 2.

-------------------------------------
author: Carlie Harper
date: 2011-03-11 08:30:48.000000000

Patch Set 2: I would prefer that you didn't submit this

(6 inline comments)

I like the idea to open up EGit by offering extension points. The problem is that we have not yet really discussed about a concept of a public API. At the moment all packages are marked as internal.

I still do not quite understand the use-case to manipulate the set of files to be committed. This would be very intransparent to the user.

Line:26, org.eclipse.egit.ui/src/org/eclipse/egit/ui/CommitObserver.java -> I think CommitOperation should not be part of an EGit API. It has for example a public execute method which then could be run by any other bundle. We would need another data container class with the information needed for commit which could be manipulated by the Observer.

Line:6, org.eclipse.egit.ui/plugin.xml -> whitespace error

Line:40, org.eclipse.egit.ui/META-INF/MANIFEST.MF -> I think this is not needed

Line:26, org.eclipse.egit.ui/schema/commitObserver.exsd -> whitespace error

Line:166, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java -> This should be a method of its own (yes, other parts of commit() also should).

Line:272, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java -> This should be a method of its own.

-------------------------------------
author: Jordin Monroe
date: 2011-03-11 10:04:30.000000000

Patch Set 2:

I see, you need first to discuss what you want to offer as EGit API.

You are right, that it is untransparent to the user, if somebody can change the resources without the knowledge of a user. In the finalizeCommit phase, I am interacting with another system. By this interaction it is possible that some local files change and for my need I _must_ commit these changed files as well.

Maybe we can show the user in that case a second dialog, so that all files for commit are viewable to the user. If the user does not like the modified commit, than the commit process may be canceled.
But I need to interact on the selected resources, so putting this phase before showing the first dialog is not an option for me.

If you do not want to let the class “CommitOperation“ be accessible, than I need to add an additional “call-back” method to the CommitObserver. The CommitObserver should be notified if the commit was successful or not.

You proposed a data container class with the information needed for commit which could be manipulated by the Observer.
It would be great if a CommitObserver-Developer would not need to handle with “indexedFiles” and “untrackedFiles”, only with the files that should be committed. Meta-information should be handled as a black box (in the container or later).
Would you expect that I should write such a container? I could try to do this if wanted, but at the moment I am not so sure about the requirements for the container. Maybe we should discuss this before.

Cheers Adrian

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