GNU bug report logs - #78213
should produce a diff with similar lines grouped together if possible

Previous Next

Package: diffutils;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Fri, 2 May 2025 14:19:02 UTC

Severity: normal

Full log


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

From: Vincent Lefevre <vincent <at> vinc17.net>
To: bug-diffutils <at> gnu.org
Subject: should produce a diff with similar lines grouped together if possible
Date: Fri, 2 May 2025 16:18:26 +0200
[Message part 1 (text/plain, inline)]
"diff" should produce a diff with similar lines grouped together if
possible, so that it can be more easily readable and be word-diff
friendly.

Issues can occur on text files with paragraphs separated by a blank
line (like in wiki source files and LaTeX files), where a modification
consists in
  * some paragraph being split, and
  * some of the following paragraphs being slightly modified.

In such a case, a shift of the slightly modified lines can occur,
which makes the diff hardly readable and breaks word-diff (e.g.
when one opens the diff file with GNU Emacs).

I've attached an example:
  * file1 and file2: the files to be diff'ed (file2 is similar to
    file1, with the first paragraph split).
  * file-bad.diff: the diff produced by diff 3.10.
  * file-ok.diff: the diff I would expect.

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
[file1 (text/plain, attachment)]
[file2 (text/plain, attachment)]
[file-bad.diff (text/plain, attachment)]
[file-ok.diff (text/plain, attachment)]

This bug report was last modified 43 days ago.

Previous Next


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