Class MergeMessageFormatter


  • public class MergeMessageFormatter
    extends Object
    Formatter for constructing the commit message for a merge commit.

    The format should be the same as C Git does it, for compatibility.

    • Constructor Detail

      • MergeMessageFormatter

        public MergeMessageFormatter()
    • Method Detail

      • format

        public String format​(List<Ref> refsToMerge,
                             Ref target)
        Construct the merge commit message.
        Parameters:
        refsToMerge - the refs which will be merged
        target - the branch ref which will be merged into
        Returns:
        merge commit message
      • formatWithConflicts

        @Deprecated
        public String formatWithConflicts​(String message,
                                          List<String> conflictingPaths)
        Deprecated.
        Add section with conflicting paths to merge message. Lines are prefixed with a hash.
        Parameters:
        message - the original merge message
        conflictingPaths - the paths with conflicts
        Returns:
        merge message with conflicting paths added
      • formatWithConflicts

        public String formatWithConflicts​(String message,
                                          Iterable<String> conflictingPaths,
                                          char commentChar)
        Add section with conflicting paths to merge message.
        Parameters:
        message - the original merge message
        conflictingPaths - the paths with conflicts
        commentChar - comment character to use for prefixing the conflict lines
        Returns:
        merge message with conflicting paths added
        Since:
        6.1