Package com.google.gerrit.server.git
Interface ChangeMessageModifier
public interface ChangeMessageModifier
Allows to modify the commit message for new commits generated by Rebase Always submit strategy.
Invoked by Gerrit when all information about new commit is already known such as parent(s), tree hash, etc, but commit's message can still be modified.
-
Method Summary
Modifier and TypeMethodDescriptiononSubmit
(String newCommitMessage, org.eclipse.jgit.revwalk.RevCommit original, org.eclipse.jgit.revwalk.RevCommit mergeTip, BranchNameKey destination) Implementation must return non-Null commit message.
-
Method Details
-
onSubmit
String onSubmit(String newCommitMessage, org.eclipse.jgit.revwalk.RevCommit original, org.eclipse.jgit.revwalk.RevCommit mergeTip, BranchNameKey destination) Implementation must return non-Null commit message.mergeTip and original commit are guaranteed to have their body parsed, meaning that their commit messages and footers can be accessed.
- Parameters:
newCommitMessage
- the new commit message that was result of eitherMergeUtil.createDetailedCommitMessage(org.eclipse.jgit.revwalk.RevCommit, com.google.gerrit.server.notedb.ChangeNotes, com.google.gerrit.entities.PatchSet.Id)
called before- other extensions or plugins implementing the same point and called before.
original
- the commit of the change being submitted. Note that its commit message may be different than newCommitMessage argument.mergeTip
- the current HEAD of the destination branch, which will be a parent of a new commit being generated. mergeTip can be null if the destination branch does not yet exist.destination
- the branch onto which the change is being submitted- Returns:
- a new not null commit message.
-