path: root/Documentation/diff-options.txt
diff options
authorStefan Beller <>2017-06-30 20:53:10 (GMT)
committerJunio C Hamano <>2017-06-30 20:59:42 (GMT)
commit61e89eaae8824926dc03c47e6ab3aa990b5b832e (patch)
tree6cd01e56dc1797fe159dfe812d3dba30524f103d /Documentation/diff-options.txt
parent86b452e2769e80b220327b1301c7487ad4afa4f4 (diff)
diff: document the new --color-moved setting
Signed-off-by: Stefan Beller <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/diff-options.txt')
1 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 89cc0f4..bc52bd0 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -231,6 +231,42 @@ ifdef::git-diff[]
It is the same as `--color=never`.
+ Moved lines of code are colored differently.
+ It can be changed by the `diff.colorMoved` configuration setting.
+ 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:
+ Moved lines are not highlighted.
+ Is a synonym for `zebra`. This may change to a more sensible mode
+ in the future.
+ 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.
+ 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.
+ 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.
Show a word diff, using the <mode> to delimit changed words.
By default, words are delimited by whitespace; see