diff reports bogus differences on identical files

Bug #1417568 reported by teo1978
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diffutils (Ubuntu)
New
Undecided
Unassigned

Bug Description

I run
  diff file1 file2

and I get a result where every single line of file1 is removed and then every single line of file2 is added.

I look at them and they look identical.

Then I copy and paste the two files at https://www.diffchecker.com/diff and it confirms that they are absolutely identical.

I wanted to report this upstream, but I can't find a public a bugtracker. Is it possible that they use a f*****g mailing list to discuss bugs?? Omg.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: diffutils 1:3.3-1
ProcVersionSignature: Ubuntu 3.13.0-44.73-generic 3.13.11-ckt12
Uname: Linux 3.13.0-44-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.6
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Feb 3 14:10:33 2015
Dependencies:
 gcc-4.9-base 4.9.1-0ubuntu1
 libc6 2.19-0ubuntu6.5
 libgcc1 1:4.9.1-0ubuntu1
 multiarch-support 2.19-0ubuntu6.5
InstallationDate: Installed on 2013-10-11 (479 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
SourcePackage: diffutils
UpgradeStatus: Upgraded to trusty on 2014-05-24 (254 days ago)

Revision history for this message
teo1978 (teo8976) wrote :
Revision history for this message
Andreas Olsson (andol) wrote :

Would it be possible for you to provide two (non-sensitive) example files showing this behavior?

Changed in diffutils (Ubuntu):
status: New → Incomplete
Revision history for this message
teo1978 (teo8976) wrote :

"non sensitive" is the problem :(

But now that I think about it, I have a suspect of the possible cause.

It could be that one file had linux-style newlines, and the other window-style newlines (one being \r and the other \r\n, never remember which is which).

So, the two filews would technically have one different character at the end of each line though they would look identical and print identical and compare identical when copied and pasted.

Is there an option to ignore different kinds of newline (i.e. consider \r\n equal to \n alone, and other flavours of newline strings at the end of a line)? I can't find such an option. If it exists, then this bug is invalid, but if it doesn't exist it should definitely be added.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for diffutils (Ubuntu) because there has been no activity for 60 days.]

Changed in diffutils (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Teo (teo1978) wrote :

I forgot to change the "incomplete" status when I responded to the request for information.

Changed in diffutils (Ubuntu):
status: Expired → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.