GNU bug report logs - #51958
Difference between "diff" and "diff3"

Previous Next

Package: diffutils;

Reported by: <marc <at> marcbernardtools.com>

Date: Thu, 18 Nov 2021 22:40:02 UTC

Severity: normal

To reply to this bug, email your comments to 51958 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#51958; Package diffutils. (Thu, 18 Nov 2021 22:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to <marc <at> marcbernardtools.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Thu, 18 Nov 2021 22:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <marc <at> marcbernardtools.com>
To: <bug-diffutils <at> gnu.org>
Subject: Difference between "diff" and "diff3"
Date: Thu, 18 Nov 2021 15:04:55 -0500
[Message part 1 (text/plain, inline)]
Hello Everyone,

 

If the end of an inserted block matches the end of the block preceding the
insert, then the output between "diff" and "diff3" is not the same. 

 

It looks like "diff" takes LCS from the end up, while "diff3" goes top down
which is more natural to the eye (see attached VS Code output, which matched
diff3). 

 

Is this a known issue, intended, or something that should be addressed?

 

Kind regards,

Marc

 

PS: This is based on diffutils 3.8 stable

 

mbtlinux:/sap/downloads # diff original.txt after_change.txt

6a7

>     METHODS test_3.

16a18,26

>     IF 1 = 2.

>       BREAK-POINT.

>     ENDIF.

>   ENDMETHOD.

> 

> 

> 

>   METHOD test_3.

>     "method 3

mbtlinux:/sap/downloads # diff3 original.txt original.txt after_change.txt

====3

1:6a

2:6a

3:7c

      METHODS test_3.

====3

1:21a

2:21a

3:23,31c

 

 

    METHOD test_3.

      "method 3

      IF 1 = 2.

        BREAK-POINT.

      ENDIF.

    ENDMETHOD.

 

mbtlinux:/sap/downloads #

[Message part 2 (text/html, inline)]
[original.txt (text/plain, attachment)]
[after_change.txt (text/plain, attachment)]
[diff_diff3_output.txt (text/plain, attachment)]
[VSCode.png (image/png, attachment)]

This bug report was last modified 3 years and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.