Subject: bug#78213: [bug-diffutils] bug#78213: should produce a diff with similar lines grouped together if possible

From: Vincent Lefevre <[email-masked]>
Date: Sat, 3 May 2025 11:45:45 +0200

On 2025-05-03 11:24:10 +0200, Vincent Lefevre wrote:
> On 2025-05-03 01:12:44 -0700, Robert Webb wrote:
> >       Long lines - Use 'less -S'  :-)
> 
> Well, be careful that the difference between the lines are at the end.
> I generated the files with "lorem -p 5" as the goal was to generate
> 5 paragraphs (and there is no way to get shorter paragraphs), and
> slightly editing them. I now think that "lorem -s 5" (to generate
> 5 sentences in a single paragraph) would have been better here since
> I had to add blank lines for the testcase anyway.

Here's a new version of the testcase, with files having short lines.

Note: To obtain file-ok.diff, I first added a character in the
first empty line of "file2", generated the diff with "diff -u"
(with the added character, the issue with the first common empty
lines disappears, so that the diff is good), then removed the
character from the generated diff.

-- 
Vincent Lefèvre <[email-masked]> - 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
+++ file2
@@ -1,9 +1,11 @@
-Quo esse rem temporibus. Et omnis quos suscipit.
+Quo esse rem temporibus. FOO
 
-Reprehenderit maxime nesciunt voluptatum placeat veniam et.
+Et omnis quos suscipit. FOO
 
-Dolorem qui minima eaque fuga ut est in.
+Reprehenderit maxime nesciunt voluptatum placeat veniam et. FOO
 
-In officiis amet dignissimos neque earum autem soluta.
+Dolorem qui minima eaque fuga ut est in. FOO
 
-Beatae quo ut odio.
+In officiis amet dignissimos neque earum autem soluta. FOO
+
+Beatae quo ut odio. FOO
--- file1
+++ file2
@@ -1,9 +1,11 @@
-Quo esse rem temporibus. Et omnis quos suscipit.
+Quo esse rem temporibus. FOO
+
+Et omnis quos suscipit. FOO
 
-Reprehenderit maxime nesciunt voluptatum placeat veniam et.
+Reprehenderit maxime nesciunt voluptatum placeat veniam et. FOO
 
-Dolorem qui minima eaque fuga ut est in.
+Dolorem qui minima eaque fuga ut est in. FOO
 
-In officiis amet dignissimos neque earum autem soluta.
+In officiis amet dignissimos neque earum autem soluta. FOO
 
-Beatae quo ut odio.
+Beatae quo ut odio. FOO