public interface GitDiffBuilder extends GitDiffCoreBuilder<GitDiffBuilder>
diff-core builder
with options specific to git diff
.ENV_AUTHOR_DATE, ENV_AUTHOR_EMAIL, ENV_AUTHOR_NAME, ENV_COMMITTER_DATE, ENV_COMMITTER_EMAIL, ENV_COMMITTER_NAME
Modifier and Type | Method and Description |
---|---|
GitDiffBuilder |
contextLines(int value)
Sets the number of context lines which should be included in the
git diff output. |
GitDiffBuilder |
defaultContextLines()
Restores the default number of context lines.
|
GitDiffBuilder |
dstPrefix(String value)
Sets the prefix to be used by git when outputing the destination path in a diff header.
|
GitDiffBuilder |
srcPrefix(String value)
Sets the prefix to be used by git when outputing the source path in a diff header.
|
GitDiffBuilder |
whitespace(GitDiffWhitespace value) |
ancestor, clearPaths, color, fullIndex, path, paths, paths, renames, renames, rev
alternate, alternates, alternates, author, author, author, build, committer, committer, committer, withConfiguration, withConfiguration, withConfiguration, withConfiguration
@Nonnull GitDiffBuilder contextLines(int value)
git diff
output. By default, git uses
3 lines. The provided value
must be greater than or equal to 0, since a negative number of context lines
has no meaning. defaultContextLines()
can be called to restore the default after using a custom value.value
- the number of context lines to include in the diff output, 0
or higherthis
IllegalArgumentException
- if the provided value
is negativedefaultContextLines()
@Nonnull GitDiffBuilder defaultContextLines()
this
contextLines(int)
@Nonnull GitDiffBuilder dstPrefix(@Nullable String value)
"b/"
.
diff --git a/file.txt b/file.txt
index 05feec6..898a7b8 100644
--- a/file.txt
+++ b/file.txt
Changing this value controls both the b/file.txt
in the diff --git
header and the +++
path after the index details.value
- the prefix to display before the destination path, may be empty or null
to use the defaultthis
@Nonnull GitDiffBuilder srcPrefix(@Nullable String value)
"a/"
.
diff --git a/file.txt b/file.txt
index 05feec6..898a7b8 100644
--- a/file.txt
+++ b/file.txt
Changing this value controls both the a/file.txt
in the diff --git
header and the ---
path after the index details.value
- the prefix to display before the source path, may be empty or null
to use the defaultthis
@Nonnull GitDiffBuilder whitespace(@Nonnull GitDiffWhitespace value)
value
- an optional flag to ignore whitespace in the diffthis
NullPointerException
- if the provided value
is null
Copyright © 2019 Atlassian. All rights reserved.