Community
Participate
Working Groups
Build Identifier: I20100608-0911 At the company I work for, we add bug IDs (and other attributes) to our cvs commit messages. Tags are used for other things. For example, one message might be "BUG#12345 Project#123456 my message here ****CUSTOM*****". It is very error-prone to make the user type this every time. We have solved this issue by pulling down the source for org.eclipse.team.cvs.ui and modifying CommitCommentArea.java. Thankfully Eclipse is open source! However, it would be good to offer this back to the community. Our approach was to make it easy to extend CommitCommentArea, not just modify the source. We created an extensionpoint and there's a new method on CommitCommentArea that tries to load the extended version instead of the vanilla CommitCommentArea. It works rather well. We keep the UI code that is specific for our needs in our own plugin and the only changes to the Eclipse source is the ability to be extended. We identified four places that instantiate CommitCommentArea and modified them to call our new method that checks for an extension. This means that if you commit something from a wizard or from a right-click of the file or anywhere, the dialog is always properly modified. In the attached screenshot, the red box highlights how we modified the commit box. When you click Finish, our plugin gets a chance to override the user's message. It's there that we put everything together in a predictable way. The attached code is what we modified in the Eclipse source to let us do this, not the actual screen changes that add the combo, check and radio options. We understand that this is likely not the best way to go about it, but it does work well for us so maybe it's a legitimate starting point. I'm aware that this class is in an internal package, but rather than cloud the intent of the change by pulling it out of the internal package and putting it elsewhere, we kept it simple and are unfortunately using internal APIs. Using mylyn is not an option since a lot of other processes here read those CVS commit messages. Reproducible: Always Steps to Reproduce: 1. Modify a file that is checked in to CVS. 2. Right-click the file and choose Team->Commit. 3. Observe that it would be nice to have some metadata that goes along with the user's commit message.
Created attachment 182441 [details] how we modify the CVS commit window
Created attachment 182442 [details] proposed patch
(In reply to comment #0) > Using mylyn is not an option since a lot of other processes here read those CVS > commit messages. Could you please elaborate on that? Why Mylyn's Commit Comment Template won't work in your case. Is the fact that you need to create a properly named task a problem here? Have you examined the set of variables you can use in the template?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.