Package org.eclipse.jgit.api
Interface RebaseCommand.InteractiveHandler2
- All Superinterfaces:
RebaseCommand.InteractiveHandler
- Enclosing class:
- RebaseCommand
Extends
RebaseCommand.InteractiveHandler
with an enhanced callback for editing
commit messages.- Since:
- 6.1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Describes the result of editing a commit message: the new message, and how it should be cleaned. -
Method Summary
Modifier and TypeMethodDescriptioneditCommitMessage
(String message, CommitConfig.CleanupMode mode, char commentChar) Callback API for editing a commit message on REWORD or SQUASH.default String
modifyCommitMessage
(String message) Used for editing commit message on REWORD or SQUASH.Methods inherited from interface org.eclipse.jgit.api.RebaseCommand.InteractiveHandler
prepareSteps
-
Method Details
-
editCommitMessage
@NonNull RebaseCommand.InteractiveHandler2.ModifyResult editCommitMessage(@NonNull String message, @NonNull CommitConfig.CleanupMode mode, char commentChar) Callback API for editing a commit message on REWORD or SQUASH.The callback gets the comment character currently set, and the clean-up mode. It can use this information when presenting the message to the user, and it also has the possibility to clean the message itself (in which case the returned
RebaseCommand.InteractiveHandler2.ModifyResult
should haveCommitConfig.CleanupMode.VERBATIM
set lest JGit cleans the message again). It can also override the initial clean-up mode by returning clean-up mode other thanCommitConfig.CleanupMode.DEFAULT
. If it does returnDEFAULT
, the passed-inmode
will be applied.- Parameters:
message
- existing commit messagemode
-CommitConfig.CleanupMode
currently setcommentChar
- comment character used- Returns:
- a
RebaseCommand.InteractiveHandler2.ModifyResult
-
modifyCommitMessage
Description copied from interface:RebaseCommand.InteractiveHandler
Used for editing commit message on REWORD or SQUASH.- Specified by:
modifyCommitMessage
in interfaceRebaseCommand.InteractiveHandler
- Parameters:
message
- existing commit message- Returns:
- new commit message
-