Bug 1868695 - colordiff -y not outputting color on CentOS 7
Summary: colordiff -y not outputting color on CentOS 7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: colordiff
Version: epel7
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Fearn
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-13 13:56 UTC by Alejandro
Modified: 2020-08-31 16:28 UTC (History)
1 user (show)

Fixed In Version: colordiff-1.0.19-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-31 16:28:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
File1a for testing (4.39 KB, text/plain)
2020-08-13 17:15 UTC, Alejandro
no flags Details
File2a for testing (4.39 KB, text/plain)
2020-08-13 17:16 UTC, Alejandro
no flags Details
File1b for testing (474 bytes, text/plain)
2020-08-13 17:18 UTC, Alejandro
no flags Details
File2b for testing (474 bytes, text/plain)
2020-08-13 17:19 UTC, Alejandro
no flags Details
colordiff 1.0.19 on CentOS 7 (30.92 KB, image/png)
2020-08-25 19:00 UTC, Richard Fearn
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github daveewart colordiff issues 47 0 None closed colordiff -y not outputting color on CentOS7 2020-08-25 18:48:33 UTC

Description Alejandro 2020-08-13 13:56:00 UTC
> 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.

Comment 1 Richard Fearn 2020-08-13 16:50:36 UTC
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.

Comment 2 Alejandro 2020-08-13 17:15:39 UTC
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

Comment 3 Alejandro 2020-08-13 17:16:54 UTC
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

Comment 4 Alejandro 2020-08-13 17:18:12 UTC
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

Comment 5 Alejandro 2020-08-13 17:19:20 UTC
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

Comment 6 Alejandro 2020-08-13 17:24:55 UTC
(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.

Comment 7 Richard Fearn 2020-08-13 22:12:01 UTC
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.

Comment 8 Alejandro 2020-08-14 12:42:34 UTC
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?

Comment 9 Richard Fearn 2020-08-14 12:50:23 UTC
(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!

Comment 10 Fedora Update System 2020-08-16 17:08:35 UTC
FEDORA-EPEL-2020-42a5acb0dc has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-42a5acb0dc

Comment 11 Fedora Update System 2020-08-17 01:34:21 UTC
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.

Comment 12 Richard Fearn 2020-08-25 19:00:16 UTC
Created attachment 1712586 [details]
colordiff 1.0.19 on CentOS 7

1.0.19 seems to work OK on CentOS 7 - see attached screenshot

Comment 13 Alejandro 2020-08-25 19:35:57 UTC
Awesome. 

I switched to the EPEL dev and downloaded it already. I have not had any issues. 

Thank you so much for your help.

Comment 14 Fedora Update System 2020-08-31 16:28:28 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.