Skip to content

Commit

Permalink
Temporary replace "diff-so-fancy" with bundled "diff-highlight"
Browse files Browse the repository at this point in the history
Related to so-fancy/diff-so-fancy#35 and so-fancy/diff-so-fancy#296.

The reason are incompatibility problems of "diff-so-fancy" (1) with the
latest Git versions caused by changes in the diff logic.

```raw
fatal: mismatched output from interactive.diffFilter
hint: Your filter must maintain a one-to-one correspondence
hint: between its input and output lines.
```

See so-fancy/diff-so-fancy#35 and so-fancy/diff-so-fancy#296 for
details.

Note that downgrading to a compatible Git version is not an option
because versions <2.17.1 are effected by CVE-2018-11233 and and
11235 (2).

To fix this problem for interactive patch mode (3) the filter will
temporary be changed to the official diff-highlight (4) tool bundled
with Git.

```diff
[interactive]
-  diffFilter = diff-so-fancy
+  diffFilter = diff-highlight
```

References:

  (1) https://github.com/so-fancy/diff-so-fancy
  (2) https://github.com/git/git/blob/master/Documentation/RelNotes/2.17.1.txt#L7-L10
  (3) https://github.com/arcticicestudio/igloo/blob/bb19634544f91c26d66e1f7f53a6bf06210fbaaf/snowblocks/git/gitconfig#L214-L220
  (4) https://github.com/git/git/tree/master/contrib/diff-highlight

Closes GH-125
  • Loading branch information
arcticicestudio committed Sep 9, 2018
1 parent bb19634 commit 535cb0a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions snowblocks/git/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
logallrefupdates = true
whitespace = tab-in-indent
editor = vim
pager = diff-so-fancy | less --tabs=4 -RFX
pager = diff-so-fancy | less --tabs=2 -RFX
attributesfile = ~/.gitattributes
excludesfile = ~/.gitignore
autocrlf = input
Expand All @@ -68,7 +68,21 @@
useUnicodeRuler = true

[interactive]
diffFilter = diff-so-fancy
# Temporary replaced "diff-so-fancy" with bundled "diff-highlight".
#
# The reason are incompatibility problems of "diff-so-fancy" with the latest Git versions caused by changes in the
# diff logic.
# See "so-fancy/diff-so-fancy#35" and "so-fancy/diff-so-fancy#296" for details.
#
# Note that downgrading to a compatible Git version is not an option because versions <2.17.1 are effected by
# CVE-2018-11233 and and 11235.
# See https://github.com/git/git/blob/master/Documentation/RelNotes/2.17.1.txt#L7-L10 for details.
#
# To fix this problem for interactive patch mode the filter has been temporary changed to the official
# "diff-highlight" tool bundled with Git.
# See https://github.com/git/git/tree/master/contrib/diff-highlight for details.
#diffFilter = diff-so-fancy
diffFilter = diff-highlight

[merge]
tool = intellij
Expand Down

0 comments on commit 535cb0a

Please sign in to comment.