aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-range-diff.txt
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-08-13 04:33:32 -0700
committerJunio C Hamano <gitster@pobox.com>2018-08-13 10:44:52 -0700
commita7be92acd96007bcb4c1fd4e8602eeb5115312c2 (patch)
treea6e3756cb551ffc507ca6d80e89db3b401b490bd /Documentation/git-range-diff.txt
parent275267937bdbb8611e8872d64adebe7587c6fa5a (diff)
downloadgit-a7be92acd96007bcb4c1fd4e8602eeb5115312c2.tar.gz
range-diff: use dim/bold cues to improve dual color mode
It *is* a confusing thing to look at a diff of diffs. All too easy is it to mix up whether the -/+ markers refer to the "inner" or the "outer" diff, i.e. whether a `+` indicates that a line was added by either the old or the new diff (or both), or whether the new diff does something different than the old diff. To make things easier to process for normal developers, we introduced the dual color mode which colors the lines according to the commit diff, i.e. lines that are added by a commit (whether old, new, or both) are colored in green. In non-dual color mode, the lines would be colored according to the outer diff: if the old commit added a line, it would be colored red (because that line addition is only present in the first commit range that was specified on the command-line, i.e. the "old" commit, but not in the second commit range, i.e. the "new" commit). However, this dual color mode is still not making things clear enough, as we are looking at two levels of diffs, and we still only pick a color according to *one* of them (the outer diff marker is colored differently, of course, but in particular with deep indentation, it is easy to lose track of that outer diff marker's background color). Therefore, let's add another dimension to the mix. Still use green/red/normal according to the commit diffs, but now also dim the lines that were only in the old commit, and use bold face for the lines that are only in the new commit. That way, it is much easier not to lose track of, say, when we are looking at a line that was added in the previous iteration of a patch series but the new iteration adds a slightly different version: the obsolete change will be dimmed, the current version of the patch will be bold. At least this developer has a much easier time reading the range-diffs that way. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-range-diff.txt')
-rw-r--r--Documentation/git-range-diff.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/Documentation/git-range-diff.txt b/Documentation/git-range-diff.txt
index 82c71c6829..f693930fdb 100644
--- a/Documentation/git-range-diff.txt
+++ b/Documentation/git-range-diff.txt
@@ -35,10 +35,19 @@ OPTIONS
When the commit diffs differ, `git range-diff` recreates the
original diffs' coloring, and adds outer -/+ diff markers with
the *background* being red/green to make it easier to see e.g.
- when there was a change in what exact lines were added. This is
- known to `range-diff` as "dual coloring". Use `--no-dual-color`
- to revert to color all lines according to the outer diff markers
- (and completely ignore the inner diff when it comes to color).
+ when there was a change in what exact lines were added.
++
+Additionally, the commit diff lines that are only present in the first commit
+range are shown "dimmed" (this can be overridden using the `color.diff.<slot>`
+config setting where `<slot>` is one of `contextDimmed`, `oldDimmed` and
+`newDimmed`), and the commit diff lines that are only present in the second
+commit range are shown in bold (which can be overridden using the config
+settings `color.diff.<slot>` with `<slot>` being one of `contextBold`,
+`oldBold` or `newBold`).
++
+This is known to `range-diff` as "dual coloring". Use `--no-dual-color`
+to revert to color all lines according to the outer diff markers
+(and completely ignore the inner diff when it comes to color).
--creation-factor=<percent>::
Set the creation/deletion cost fudge factor to `<percent>`.