summaryrefslogtreecommitdiff
path: root/Documentation/diff-options.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-27 05:55:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-27 05:55:03 (GMT)
commitb6c4058f978433c51581df87283309b611bde87b (patch)
treea15051b3c035c9e36ef0e731079c78ccbfab5afd /Documentation/diff-options.txt
parent3dc57ebfbd1bf30b9a6987f551af9b74641382a9 (diff)
parent61e89eaae8824926dc03c47e6ab3aa990b5b832e (diff)
downloadgit-b6c4058f978433c51581df87283309b611bde87b.zip
git-b6c4058f978433c51581df87283309b611bde87b.tar.gz
git-b6c4058f978433c51581df87283309b611bde87b.tar.bz2
Merge branch 'sb/diff-color-move'
"git diff" has been taught to optionally paint new lines that are the same as deleted lines elsewhere differently from genuinely new lines. * sb/diff-color-move: (25 commits) diff: document the new --color-moved setting diff.c: add dimming to moved line detection diff.c: color moved lines differently, plain mode diff.c: color moved lines differently diff.c: buffer all output if asked to diff.c: emit_diff_symbol learns about DIFF_SYMBOL_SUMMARY diff.c: emit_diff_symbol learns about DIFF_SYMBOL_STAT_SEP diff.c: convert word diffing to use emit_diff_symbol diff.c: convert show_stats to use emit_diff_symbol diff.c: convert emit_binary_diff_body to use emit_diff_symbol submodule.c: migrate diff output to use emit_diff_symbol diff.c: emit_diff_symbol learns DIFF_SYMBOL_REWRITE_DIFF diff.c: emit_diff_symbol learns about DIFF_SYMBOL_BINARY_FILES diff.c: emit_diff_symbol learns DIFF_SYMBOL_HEADER diff.c: emit_diff_symbol learns DIFF_SYMBOL_FILEPAIR_{PLUS, MINUS} diff.c: emit_diff_symbol learns DIFF_SYMBOL_CONTEXT_INCOMPLETE diff.c: emit_diff_symbol learns DIFF_SYMBOL_WORDS[_PORCELAIN] diff.c: migrate emit_line_checked to use emit_diff_symbol diff.c: emit_diff_symbol learns DIFF_SYMBOL_NO_LF_EOF diff.c: emit_diff_symbol learns DIFF_SYMBOL_CONTEXT_FRAGINFO ...
Diffstat (limited to 'Documentation/diff-options.txt')
-rw-r--r--Documentation/diff-options.txt36
1 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 56dedaf..b1ab964 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -231,6 +231,42 @@ ifdef::git-diff[]
endif::git-diff[]
It is the same as `--color=never`.
+--color-moved[=<mode>]::
+ Moved lines of code are colored differently.
+ifdef::git-diff[]
+ It can be changed by the `diff.colorMoved` configuration setting.
+endif::git-diff[]
+ The <mode> defaults to 'no' if the option is not given
+ and to 'zebra' if the option with no mode is given.
+ The mode must be one of:
++
+--
+no::
+ Moved lines are not highlighted.
+default::
+ Is a synonym for `zebra`. This may change to a more sensible mode
+ in the future.
+plain::
+ Any line that is added in one location and was removed
+ in another location will be colored with 'color.diff.newMoved'.
+ Similarly 'color.diff.oldMoved' will be used for removed lines
+ that are added somewhere else in the diff. This mode picks up any
+ moved line, but it is not very useful in a review to determine
+ if a block of code was moved without permutation.
+zebra::
+ Blocks of moved code are detected greedily. The detected blocks are
+ painted using either the 'color.diff.{old,new}Moved' color or
+ 'color.diff.{old,new}MovedAlternative'. The change between
+ the two colors indicates that a new block was detected. If there
+ are fewer than 3 adjacent moved lines, they are not marked up
+ as moved, but the regular colors 'color.diff.{old,new}' will be
+ used.
+dimmed_zebra::
+ Similar to 'zebra', but additional dimming of uninteresting parts
+ of moved code is performed. The bordering lines of two adjacent
+ blocks are considered interesting, the rest is uninteresting.
+--
+
--word-diff[=<mode>]::
Show a word diff, using the <mode> to delimit changed words.
By default, words are delimited by whitespace; see