so-fancy / diff-so-fancy

Good-lookin' diffs. Actually… nah… The best-lookin' diffs. :tada:
MIT License
17.28k stars 330 forks source link

Diff coloring of each file is good but the diff coloring with 2 files seems broken #458

Closed utix closed 5 months ago

utix commented 1 year ago

Images to show the issues: image

image

The diffs are quite simple

raw diff

diff --git a/ci/images/ubuntu-dind/install.sh b/ci/images/ubuntu-dind/install.sh
index 554923f549..a5049b156c 100644
--- a/ci/images/ubuntu-dind/install.sh
+++ b/ci/images/ubuntu-dind/install.sh
@@ -12,3 +12,14 @@ node --version
 # Install Chrome browser and Cypress
 curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb
 dpkg -i /chrome.deb || apt-get install -yf
+
+# Install postgresql and prepare it for application
+apt -y install vim bash-completion wget
+apt-get install -y locales
+sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
+apt-get update
+
+locale-gen en_US.UTF-8
+
+apt-get install postgresql-14 postgresql-contrib-14 -y
diff --git a/ci/utils/installers/database/install-postgre.sh b/ci/utils/installers/database/install-postgre.sh
index 26091d71e1..77ed86c8af 100755
--- a/ci/utils/installers/database/install-postgre.sh
+++ b/ci/utils/installers/database/install-postgre.sh
@@ -1,16 +1,3 @@
 #!/bin/bash

-# /!\ Only use it in image based on a distribution that provides apt as package manager
-
-# Install postgresql and prepare it for application
-apt update
-apt -y install vim bash-completion wget
-apt-get install -y locales
-sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
-wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
-apt-get update
-
-locale-gen en_US.UTF-8
-
-apt-get install postgresql-14 postgresql-contrib-14 -y
 pg_ctlcluster 14 main start

Git conf

[pager]
        color = true
  diff = diff-so-fancy | less --tabs=4 -RFX
  show = diff-so-fancy | less --tabs=4 -RFX
[diff]
    color = auto
    algorithm = histogram
    colorMoved = dimmed-zebra
[diff "color"]
        meta = green
        frag = yellow
        old = magenta
        new = cyan
        whitespace = red reverse
[color "diff-highlight"]
        oldNormal = red
        oldHighlight = 9 ul 52
        newNormal = green
        newHighlight = 10 ul 22
utix commented 1 year ago

diff.txt

utix commented 1 year ago

The problem seems to come from diff-highlight itself

image

HaleTom commented 1 year ago

Do you have colorMoved=zebra or dimmed-zebra?

dcervenkov commented 5 months ago

This issue has been stale for a while. However, I'm seeing the same issue. Are there any plans to address this?

OJFord commented 5 months ago

Since the issue is present with plain diff-highlight, there's not really anything for dsf to do here - suggest you check/report in git's bug tracker.