Open guyg-codes opened 2 years ago
I've just attempted to replicate this issue (Mac Mini M1, Monterey 12.3.1) and cannot do so. It works fine for me. Have also tried various files to test comparison.
Unclear why this isn't working for you: are you able to share an example pair of files for which you see it failing?
Hi @daveewart, I played around some more and I thought I had found the culprit - the original file(s) I was trying to diff include an unusual unicode character (↳ - https://unicode-table.com/en/21B3/).
After more testing, it's unclear this char/line is the problem, I can't reproduce the issue copying the line or recreating the issue with the char in some test files.
Testing more generally with other files, colordiff -y
does appear to be working with coloured output.
Not quite sure where to take it from here. I'm also unclear what your attachments are about: first one is init.vim and the second one is a Google Drive link that is asking me to request access.
I'm tempted to close this Issue, unless you have a reproducible test case?
Hi Dave, thanks for your patience - apparently generating a public link for a Gdrive file doesn't also set the sharing permissions to public, file2 should be accessible now.
OK, interesting.
colordiff -y init.vim.tmp_adoc_folds init.vim
produces coloured output, but
colordiff -y init.vim init.vim.tmp_adoc_folds
does not. I think I understand why. It is likely to be because this is a very 'asymmetric' diff.
Explanation: colordiff does not understand diff operations, it is simply taking the (text) output of a diff and attempting to interpret it. For 'diff -y' it has to do a lot of work to try to detect where the middle separators are (the '<', '>' and '|'). It does this by looking for one of those characters with a space on either side. (See the code for the details). In your example, because one of the files is almost empty, there is nothing at all for most of the compared lines: when the short file is the second listed, the lines all end with ' <' with no following space, thus the script fails to identify the separator location.
I don't think there's much can be done with this, although I guess that diff-detection code could be extended.
I'm able to get coloured output with a standard colordiff, but not when the -y arg (side-by-side output) is provided.
A previous issue on this topic appeared to be resolved by updating to the latest colordiff release, I believe I am already running on 1.0.20
colordiff --version
which colordiff
brew info colordiff
Issue Detail
The output of the following to commands is identical (i.e. no colouring at all)
colordiff -y file1 file2
diff -y file1 file2 | colordiff
Steps Taken
I have tried to run with a variety of additional args (--strip-trailing, --supress-common-lines) and tried diff'ing several files - all with the same result.
Any help would be much appreciated, colordiff is a huge improvement over the original diff, much appreciation for your work! Cheers, Guy