Top Description Constructors Methods
org.eclipse.jgit.merge

public Class MergeMessageFormatter

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, org.eclipse.jgit.lib.Constants, .ObjectId, .Ref, .Repository, org.eclipse.jgit.util.ChangeIdUtil, .StringUtils

Formatter for constructing the commit message for a merge commit.

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
addConflictsMessage(Iterable<String> conflictingPaths, StringBuilder sb, char commentChar)

public String

Returns:

merge commit message
format
(List<Ref>
the refs which will be merged
refsToMerge
,
Ref
the branch ref which will be merged into
target
)

Construct the merge commit message.

public String

Returns:

merge message with conflicting paths added
formatWithConflicts
(String
the original merge message
message
,
Iterable<String>
the paths with conflicts
conflictingPaths
,
char
comment character to use for prefixing the conflict lines
commentChar
)

Add section with conflicting paths to merge message.

private static String
joinNames(List<String> names, String singular, String plural)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MergeMessageFormatterback to summary
public MergeMessageFormatter()

Method Detail

addConflictsMessageback to summary
private static void addConflictsMessage(Iterable<String> conflictingPaths, StringBuilder sb, char commentChar)
formatback to summary
public String format(List<Ref> refsToMerge, Ref target)

Construct the merge commit message.

Parameters
refsToMerge:List<Ref>

the refs which will be merged

target:Ref

the branch ref which will be merged into

Returns:String

merge commit message

formatWithConflictsback to summary
public String formatWithConflicts(String message, Iterable<String> conflictingPaths, char commentChar)

Add section with conflicting paths to merge message.

Parameters
message:String

the original merge message

conflictingPaths:Iterable<String>

the paths with conflicts

commentChar:char

comment character to use for prefixing the conflict lines

Returns:String

merge message with conflicting paths added

Since
6.1
joinNamesback to summary
private static String joinNames(List<String> names, String singular, String plural)