GNU bug report logs - #46550
bug in diff -r?

Previous Next

Package: diffutils;

Reported by: Stan Schymanski <schymans <at> gmail.com>

Date: Tue, 16 Feb 2021 00:22:01 UTC

Severity: normal

To reply to this bug, email your comments to 46550 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#46550; Package diffutils. (Tue, 16 Feb 2021 00:22:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stan Schymanski <schymans <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Tue, 16 Feb 2021 00:22:01 GMT) Full text and rfc822 format available.

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

From: Stan Schymanski <schymans <at> gmail.com>
To: bug-diffutils <at> gnu.org
Subject: bug in diff -r?
Date: Mon, 15 Feb 2021 22:56:38 +0100
Dear all,

I cannot get diff -r to search recursively. Here is an example. First I
create two folders, each with one sub-folder and one file, where each
sub-folder and file has a different content:
```
$ mkdir orig
$ mkdir backup
$ mkdir orig/1
$ mkdir backup/2
$ echo 'blah' > orig/1/test.txt
$ ls orig/1
test.txt
$ echo 'blah1' > backup/2/test1.txt
```
Now I compare them using the '-qr' option:

```
$ diff -qr orig/ backup/
Only in orig/: 1
Only in backup/: 2
```
I was expecting to be told that orig/1/test.txt and backup/2/test1.txt
are unique. If I descend into the subfolder in one of them, the file in
that folder is found:
```
$ diff -r orig/1 backup/
Only in backup/: 2
Only in orig/1: test.txt
```
I actually get the same behaviour with or without '-qr'. Is this a bug
or am I misunderstanding diff -r? I am using diff (GNU diffutils) 3.7.

Cheers
Stan




Information forwarded to bug-diffutils <at> gnu.org:
bug#46550; Package diffutils. (Tue, 16 Feb 2021 17:23:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stan Schymanski <schymans <at> gmail.com>, 46550 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#46550: bug in diff -r?
Date: Tue, 16 Feb 2021 09:22:22 -0800
On 2/15/21 1:56 PM, Stan Schymanski wrote:
> Is this a bug
> or am I misunderstanding diff -r?

Perhaps a bit of both. The algorithm you want (which is to pretend that 
directories missing in A are empty in B, and vice versa) is not the 
algorithm that 'diff -r A B' uses.




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

Previous Next


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