Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Modify commit message from Eclipse plugin
Modify commit message from Eclipse plugin [message #1763583] Wed, 17 May 2017 11:46 Go to next message
Eclipse UserFriend
Hi,

I'm working on an Eclipse RCP plugin that is supposed to modify (according to some settings) the commit message in the Git Staging View and Commit Dialog. I can see that this feature is available in the EGit Mylyn plugin where the message is preset to match the currently selected task. I cloned the GitHub Mylyn Connector from https://github.com/eclipse/egit-github and I'm trying to figure out how this is achieved. Can you point me to some relevant code samples or give me any helpful hints?

Thanks
Re: Modify commit message from Eclipse plugin [message #1763771 is a reply to message #1763583] Fri, 19 May 2017 09:03 Go to previous messageGo to next message
Eclipse UserFriend
Modifying an existing commit message is not supported.

You can provide an initial commit message with a ICommitMessageProvider registered through the org.eclipse.egit.ui.commitMessageProvider extension point.

For instance:
package org.example.myapp;

import org.eclipse.core.resources.IResource;
import org.eclipse.egit.ui.ICommitMessageProvider;

public class DummyCommitMessageProvider implements ICommitMessageProvider {

	@Override
	public String getMessage(IResource[] resources) {
		return "This is a dummy message\n";
	}

}

and in your bundle's plugin.xml:
 <extension
         id="org.example.myapp.commitMessage"
         point="org.eclipse.egit.ui.commitMessageProvider">
    <commitMessageProvider
            class="org.example.myapp.DummyCommitMessageProvider">
    </commitMessageProvider>
 </extension>
Re: Modify commit message from Eclipse plugin [message #1808708 is a reply to message #1763771] Fri, 28 June 2019 20:05 Go to previous message
Eclipse UserFriend
does this still work ? I have the exact same thing (just by reverse engineering :P) but it doesnt do anything
Previous Topic:Comparing files from "Unstaged Changes" showing whitespace which should not be there
Next Topic:Beginner Problems
Goto Forum:
  


Current Time: Thu Jul 03 12:27:02 EDT 2025

Powered by FUDForum. Page generated in 0.06479 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top