GNU bug report logs - #76452
3.11 critical bug: diff -Naur a b does not show a unified diff when one of the file is empty

Previous Next

Package: diffutils;

Reported by: Kate Deplaix <kit-ty-kate <at> outlook.com>

Date: Fri, 21 Feb 2025 04:48:04 UTC

Severity: normal

Merged with 76453, 76454

Found in version 3.11

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#76452: closed (3.11 critical bug: diff -Naur a b does not
 show a unified diff when one of the file is empty)
Date: Sat, 22 Feb 2025 06:12:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 21 Feb 2025 23:11:22 -0700
with message-id <27b53198-137f-4e37-8f99-b539e365d4ff <at> cs.ucla.edu>
and subject line Re: [bug-diffutils] bug#76452: 3.11 critical bug: diff -Naur a b does not show a unified diff when one of the file is empty
has caused the debbugs.gnu.org bug report #76452,
regarding 3.11 critical bug: diff -Naur a b does not show a unified diff when one of the file is empty
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
76452: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76452
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Kate Deplaix <kit-ty-kate <at> outlook.com>
To: "bug-diffutils <at> gnu.org" <bug-diffutils <at> gnu.org>
Subject: 3.11 critical bug: diff -Naur a b does not show a unified diff when
 one of the file is empty
Date: Thu, 20 Feb 2025 15:25:05 +0000
[Message part 3 (text/plain, inline)]
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
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Collin Funk <collin.funk1 <at> gmail.com>
Cc: 76452-done <at> debbugs.gnu.org, Kate Deplaix <kit-ty-kate <at> outlook.com>
Subject: Re: [bug-diffutils] bug#76452: 3.11 critical bug: diff -Naur a b does
 not show a unified diff when one of the file is empty
Date: Fri, 21 Feb 2025 23:11:22 -0700
[Message part 6 (text/plain, inline)]
Thanks for the diagnosis and the patch. I installed the attached 
instead, so as to decouple this part of the code from the part that 
turns file types into strings.
[0001-diff-don-t-treat-empty-files-as-a-different-file-typ.patch (text/x-patch, attachment)]
[0001-maint-mention-bug-76452-in-NEWS.patch (text/x-patch, attachment)]

This bug report was last modified 60 days ago.

Previous Next


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