> I recently posted https://github.com/daveewart/colordiff/issues/47 of what I thought was user error while using `colordiff` but after some troubleshooting, I believe that it is a bug. According to the maintainer, he suggests using a newer version specifically at least 1.0.14. https://github.com/daveewart/colordiff/issues/47#issuecomment-672997730 Looks like Fedora has at least 1.0.18-7.fc32 as of 2017-06-24 03:08:47 UTC according to https://bugzilla.redhat.com/show_bug.cgi?id=1458456 Below is a copy of my original bug report. ---------------------------------------------------------------------- For the life of me, I cannot get `colordiff` to output color to the terminal. I feel like I am missing something simple. Environment: - `cat /etc/centos-release` = CentOS Linux release 7.5.1804 (Core) - `colordiff --version` = diff (GNU diffutils) 3.3 - `sudo yum info diffutils` = Version : 3.3 | Release : 5.el7 - `sudo yum info colordiff` = Version : 1.0.13 | Release : 2.el7 - Terminal = PuTTY Release 0.74 - OS = Microsoft Windows 10 Home | Version 10.0.19041 Build 19041 The specific command I am trying: - `\colordiff -y --left-column /opt/projects/openidm/subscribers/conf/authentication.json /opt/projects/git/subscribers/conf/authentication.json` Commands I have tried but will not output color: - `\colordiff -y --left-column <File-1> <File-2>` - `\colordiff -y --left-column --difftype=diffy <File-1> <File-2>` Commands that will output color in the terminal for all files: - `\colordiff <File-1> <File-2>` - `\colordiff -y --ignore-trailing-space <File-1> <File-2>` - `\colordiff -y --ignore-trailing-space --suppress-common-lines <File-1> <File-2>` - `\colordiff -y --left-column --ignore-trailing-space --suppress-common-lines <File-1> <File-2>` Commands that output color depending on the type of "diffs" in the files: - `\colordiff -y --left-column --suppress-common-lines <File-1> <File-2>` - `\colordiff -y --left-column --suppress-common-lines --difftype=diffy <File-1> <File-2>` - `\colordiff -y --suppress-common-lines <File-1> <File-2>` - `\colordiff -y --suppress-common-lines --difftype=diffy <File-1> <File-2>` - `\colordiff -y <File-1> <File-2>` - `\colordiff -y --difftype=diffy <File-1> <File-2>` - `\diff -y <File-1> <File-2> | \colordiff` - `\diff -y <File-1> <File-2> | \colordiff --difftype=diffy` Note: I have preceded most commands with a `\` to make sure no aliases are involved. Update: After trying multiple files for comparison, it turns out that the original files I was comparing had a trailing space that was causing an issue. That said, the issue still requires that I add `--suppress-common-lines` to my original command, even though in my case, that only removes 2 lines from the output. ---------------------------------- How reproducible: I am able to reproduce the issue every time. Steps to Reproduce: 1. Create 2 json files 2. Run command `colordiff -y <File-1> <File-2>` Additional info: This is my first bug report, so if I am missing something let me know and I will update this.
Could you attach JSON files that can be used to reproduce the problem? (I do get coloured output from `colordiff -y --left-column <file1> <file2>`, connecting from Windows 10 to a CentOS 7 VM, using PuTTY 0.74.) I agree that 1.0.13 is ancient though... I'll see about getting it updated.
Created attachment 1711347 [details] File1a for testing This is the location on my system in case that has something to do with it. /opt/projects/openidm/subscribers/conf/authenication.json
Created attachment 1711348 [details] File2a for testing This is the location of the file on my system in case that has anything to do with it. /opt/projects/git/subscribers/conf/authentication.json
Created attachment 1711350 [details] File1b for testing This is the location of the file on my system in case that has anything to do with it. /opt/projects/openidm/subscribconsole.json
Created attachment 1711351 [details] File2b for testing This is the location on my system in case that has anything to do with it. /opt/subscribers/conf/felix.webconsole.json
(In reply to Richard Fearn from comment #1) > Could you attach JSON files that can be used to reproduce the problem? (I do > get coloured output from `colordiff -y --left-column <file1> <file2>`, > connecting from Windows 10 to a CentOS 7 VM, using PuTTY 0.74.) > > I agree that 1.0.13 is ancient though... I'll see about getting it updated. I have attached 2 sets of files for testing. On my system both do not output color with the following commands: \colordiff -y --left-column /opt/projects/openidm/subscribers/conf/authentication.json /opt/projects/git/subscribers/conf/authentication.json \colordiff -y --left-column /opt/projects/openidm/subscribers/conf/felix.webconsole.json /opt/projects/git/subscribers/conf/felix.webconsole.json But, they do output color when adding the `--suppress-common-lines` option as below. \colordiff -y --left-column --suppress-common-lines /opt/projects/openidm/subscribers/conf/authentication.json /opt/projects/git/subscribers/conf/authentication.json \colordiff -y --left-column --suppress-common-lines /opt/projects/openidm/subscribers/conf/felix.webconsole.json /opt/projects/git/subscribers/conf/felix.webconsole.json Do not worry about the contents of the files as they are part of a course I am taking. They were one time use and have already been changed.
Thanks for the attachments - I can see the issue with the JSON files (attachment.json). The `--left-column` option causes it to output `(` on each line that's the same on both sides. Looks like colordiff was fixed to recognise this in https://github.com/daveewart/colordiff/commit/bd7ee1160997a8dc89645ef627f217b17a33d9d9. 1.0.14 was the first version to include that change.
Glad I was able to help narrow down the issue. I look forward to the newer version. Do I need to do anything else with this bug report?
(In reply to Alejandro from comment #8) > Glad I was able to help narrow down the issue. > I look forward to the newer version. > > Do I need to do anything else with this bug report? No, leave it as-is and it'll get closed when the colordiff update goes out. Thanks!
FEDORA-EPEL-2020-42a5acb0dc has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-42a5acb0dc
FEDORA-EPEL-2020-42a5acb0dc has been pushed to the Fedora EPEL 7 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-42a5acb0dc See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
Created attachment 1712586 [details] colordiff 1.0.19 on CentOS 7 1.0.19 seems to work OK on CentOS 7 - see attached screenshot
Awesome. I switched to the EPEL dev and downloaded it already. I have not had any issues. Thank you so much for your help.
FEDORA-EPEL-2020-42a5acb0dc has been pushed to the Fedora EPEL 7 stable repository. If problem still persists, please make note of it in this bug report.