Subject: 3.11 critical bug: diff -Naur a b does not show a unified diff when one of the file is empty
From: Kate Deplaix <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Thu, 20 Feb 2025 15:25:05 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

While using diffutils 3.11 instead of 3.10, i've noticed a critical bug in diff reproducible with the following setup:

$ cd /tmp
$ mkdir a b
$ touch a/test
$ echo content > b/test

With diffutils 3.10, "diff -Naur a b" returns:

diff -Naur a/test b/test
--- a/test   2025-02-20 14:50:07.870258052 +0000
+++ b/test   2025-02-20 14:50:18.957287641 +0000
@@ -0,0 +1 @@
+content

but with diffutils 3.11, the same command returns:

File a/test is a regular empty file while file b/test is a regular file

Given no mention of this change appear in the changelog, i'm guessing this is an unintended change. In my opinion this bug is critical and the 3.11 release should be marked as broken to avoid more distributions using it.

Warm regards,
Kate Deplaix