Class MergeMessageFormatter


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

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

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private static void addConflictsMessage​(java.lang.Iterable<java.lang.String> conflictingPaths, java.lang.StringBuilder sb, char commentChar)  
      java.lang.String format​(java.util.List<Ref> refsToMerge, Ref target)
      Construct the merge commit message.
      java.lang.String formatWithConflicts​(java.lang.String message, java.lang.Iterable<java.lang.String> conflictingPaths, char commentChar)
      Add section with conflicting paths to merge message.
      java.lang.String formatWithConflicts​(java.lang.String message, java.util.List<java.lang.String> conflictingPaths)
      Deprecated.
      private static java.lang.String joinNames​(java.util.List<java.lang.String> names, java.lang.String singular, java.lang.String plural)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MergeMessageFormatter

        public MergeMessageFormatter()
    • Method Detail

      • format

        public java.lang.String format​(java.util.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 java.lang.String formatWithConflicts​(java.lang.String message,
                                                    java.util.List<java.lang.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 java.lang.String formatWithConflicts​(java.lang.String message,
                                                    java.lang.Iterable<java.lang.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
      • addConflictsMessage

        private static void addConflictsMessage​(java.lang.Iterable<java.lang.String> conflictingPaths,
                                                java.lang.StringBuilder sb,
                                                char commentChar)
      • joinNames

        private static java.lang.String joinNames​(java.util.List<java.lang.String> names,
                                                  java.lang.String singular,
                                                  java.lang.String plural)