Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Modify commit message from Eclipse plugin
Modify commit message from Eclipse plugin [message #1763583] Wed, 17 May 2017 15:46 Go to next message
Mikey Hansen is currently offline Mikey HansenFriend
Messages: 1
Registered: May 2017
Junior Member
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 13:03 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
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] Sat, 29 June 2019 00:05 Go to previous message
jonathan heindl is currently offline jonathan heindlFriend
Messages: 1
Registered: June 2019
Junior Member
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: Tue Apr 23 13:06:04 GMT 2024

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

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

Back to the top