GNU bug report logs - #69752
New and improved 'diff'.

Previous Next

Package: diffutils;

Reported by: Robert Boyer <robertstephenboyer <at> gmail.com>

Date: Tue, 12 Mar 2024 16:08:02 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69752 in the body.
You can then email your comments to 69752 AT debbugs.gnu.org in the normal way.

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#69752; Package diffutils. (Tue, 12 Mar 2024 16:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robert Boyer <robertstephenboyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Tue, 12 Mar 2024 16:08:02 GMT) Full text and rfc822 format available.

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

From: Robert Boyer <robertstephenboyer <at> gmail.com>
To: bug-diffutils <at> gnu.org
Cc: rms <at> gnu.org
Subject: New and improved 'diff'.
Date: Tue, 12 Mar 2024 11:06:13 -0500
[Message part 1 (text/plain, inline)]
Here is a better version of diff, better only in the sense that it works on
all files.  But what do I know?  Nothing.

This is Common Lisp.  I was running in SBCL.

(defun my-diff (file1 file2)
  (let ((s1 (open file1 :element-type '(integer 0 255)))
        (s2 (open file2 :element-type '(integer 0 255)))
        (c1 0)
        (c2 0))
    (declare (fixnum c1 c2))
    (loop
     (setq c1 (read-byte s1 nil 256))
     (setq c2 (read-byte s2 nil 256))
     (cond ((and (eql c1 256) (eql c2 256)) (return "no difference")))
     (cond ((eql c1 256) (return "file1 hit eof first")))
     (cond ((eql c2 256) (return "file2 hit eof first")))
     (cond ((eql c1 c2))
           (t (return (format nil
                              "difference at position ~s; c1 = ~s, c2 = ~s."
                              (file-position s1) c1 c2)))))))
[Message part 2 (text/html, inline)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#69752; Package diffutils. (Tue, 12 Mar 2024 20:16:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Robert Boyer <robertstephenboyer <at> gmail.com>, 69752 <at> debbugs.gnu.org
Cc: rms <at> gnu.org
Subject: Re: [bug-diffutils] bug#69752: New and improved 'diff'.
Date: Tue, 12 Mar 2024 13:14:42 -0700
On 3/12/24 09:06, Robert Boyer wrote:
> Here is a better version of diff, better only in the sense that it works on
> all files.

Oh, for that sort of thing you can use the "cmp" command, which is part 
of diffutils. It doesn't need to read both files into RAM, so it is more 
likely to work for your situation.




Added tag(s) notabug. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Tue, 12 Mar 2024 20:21:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 69752 <at> debbugs.gnu.org and Robert Boyer <robertstephenboyer <at> gmail.com> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Tue, 12 Mar 2024 20:21:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-diffutils <at> gnu.org:
bug#69752; Package diffutils. (Tue, 12 Mar 2024 20:28:02 GMT) Full text and rfc822 format available.

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

From: Robert Boyer <robertstephenboyer <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 69752 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: [bug-diffutils] bug#69752: New and improved 'diff'.
Date: Tue, 12 Mar 2024 15:24:55 -0500
[Message part 1 (text/plain, inline)]
Thank you so very much!

I had never heard of 'cmp'!

I admit to being a very uninformed individual, and for that I apologize
profoundly.

Bob


On Tue, Mar 12, 2024 at 3:14 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote:

> On 3/12/24 09:06, Robert Boyer wrote:
> > Here is a better version of diff, better only in the sense that it works
> on
> > all files.
>
> Oh, for that sort of thing you can use the "cmp" command, which is part
> of diffutils. It doesn't need to read both files into RAM, so it is more
> likely to work for your situation.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#69752; Package diffutils. (Mon, 18 Mar 2024 14:56:02 GMT) Full text and rfc822 format available.

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

From: Robert Boyer <robertstephenboyer <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 69752 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: [bug-diffutils] bug#69752: New and improved 'diff'.
Date: Mon, 18 Mar 2024 09:25:13 -0500
[Message part 1 (text/plain, inline)]
Please ignore my last message.

I must have been having problems I do not understand.

> time cmp  primes-so-far.lisp the-primes-below-10000000000.txt
cmp: EOF on primes-so-far.lisp after byte 373882880, line 38039843

real 5m15.340s
user 0m0.705s
sys 0m0.765s

On Mon, Mar 18, 2024 at 9:11 AM Robert Boyer <robertstephenboyer <at> gmail.com>
wrote:

> > Oh, for that sort of thing you can use the "cmp" command, which is part
> > of diffutils.
>
> Not so!
>
> cmp  primes-so-far.lisp the-primes-below-10000000000.txt
> cmp: primes-so-far.lisp: Cannot allocate memory
>
> Bob
>
>
> On Tue, Mar 12, 2024 at 3:14 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote:
>
>> On 3/12/24 09:06, Robert Boyer wrote:
>> > Here is a better version of diff, better only in the sense that it
>> works on
>> > all files.
>>
>> Oh, for that sort of thing you can use the "cmp" command, which is part
>> of diffutils. It doesn't need to read both files into RAM, so it is more
>> likely to work for your situation.
>>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#69752; Package diffutils. (Mon, 18 Mar 2024 15:20:02 GMT) Full text and rfc822 format available.

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

From: Robert Boyer <robertstephenboyer <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 69752 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: [bug-diffutils] bug#69752: New and improved 'diff'.
Date: Mon, 18 Mar 2024 09:11:02 -0500
[Message part 1 (text/plain, inline)]
> Oh, for that sort of thing you can use the "cmp" command, which is part
> of diffutils.

Not so!

cmp  primes-so-far.lisp the-primes-below-10000000000.txt
cmp: primes-so-far.lisp: Cannot allocate memory

Bob


On Tue, Mar 12, 2024 at 3:14 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote:

> On 3/12/24 09:06, Robert Boyer wrote:
> > Here is a better version of diff, better only in the sense that it works
> on
> > all files.
>
> Oh, for that sort of thing you can use the "cmp" command, which is part
> of diffutils. It doesn't need to read both files into RAM, so it is more
> likely to work for your situation.
>
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 16 Apr 2024 11:24:24 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 117 days ago.

Previous Next


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