GNU bug report logs - #20250
diff by size

Previous Next

Package: diffutils;

Reported by: Andreas <wiisses <at> web.de>

Date: Fri, 3 Apr 2015 14:56:02 UTC

Severity: normal

To reply to this bug, email your comments to 20250 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#20250; Package diffutils. (Fri, 03 Apr 2015 14:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas <wiisses <at> web.de>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Fri, 03 Apr 2015 14:56:02 GMT) Full text and rfc822 format available.

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

From: Andreas <wiisses <at> web.de>
To: bug-diffutils <at> gnu.org
Subject: diff by size
Date: Fri, 03 Apr 2015 15:20:40 +0200
Dear diff-team,

this is not a bug but an idea for a diff option in further versions:

Idea:
comparison of two files by size only.

why?
makes comparison extremely fast; often no need to compare file contents
to get a first hint whether there is a difference at all

example:
- uploading a folder with a bunch of files to a slow motion cloud;
comparing each file by contents is very time consuming (...slow motion
cloud)
- as a first hint to find out about a possible difference could be the
comparison of file size for each file uploaded with the local ones


Thanks in advance for integrating this option in future diff versions.

Great tool, great diff team!
Andreas Schirra
wiisses <at> web.de







Information forwarded to bug-diffutils <at> gnu.org:
bug#20250; Package diffutils. (Tue, 07 Apr 2015 15:04:02 GMT) Full text and rfc822 format available.

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

From: Dave Gordon <david.s.gordon <at> intel.com>
To: Andreas <wiisses <at> web.de>, 20250 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#20250: diff by size
Date: Tue, 07 Apr 2015 16:03:01 +0100
On 03/04/15 14:20, Andreas wrote:
> Dear diff-team,
> 
> this is not a bug but an idea for a diff option in further versions:
> 
> Idea:
> comparison of two files by size only.
> 
> why?
> makes comparison extremely fast; often no need to compare file contents
> to get a first hint whether there is a difference at all
> 
> example:
> - uploading a folder with a bunch of files to a slow motion cloud;
> comparing each file by contents is very time consuming (...slow motion
> cloud)
> - as a first hint to find out about a possible difference could be the
> comparison of file size for each file uploaded with the local ones
> 
> Thanks in advance for integrating this option in future diff versions.
> 
> Great tool, great diff team!
> Andreas Schirra
> wiisses <at> web.de

It probably doesn't belong in diff(1), but maybe in cmp(1)? For example,
it might be a meaningful semantic for the case of "cmp -n 0", which
currently always says "equal" (-n 0 means compare at most 0 bytes), or
some other variation that isn't currently meaningful, such as "cmp -n -1
<FILE1> <FILE2>" ?

OTOH, you can easily get and compare filesizes in a script already,
for example using "stat --printf=%s <FILE>", and for the case of
synchronising with a slow remote backup, rsync(1) already incorporates
lots of clever ways to reduce the bandwidth of the remote traffic,
including using just the filesize and datestamp to check for (mis-)matches.

.Dave.




Information forwarded to bug-diffutils <at> gnu.org:
bug#20250; Package diffutils. (Mon, 09 May 2016 04:37:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Andreas <wiisses <at> web.de>
Cc: 20250 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#20250: diff by size
Date: Sun, 8 May 2016 21:36:15 -0700
tags 20250 notabug
close 20250
done

On Fri, Apr 3, 2015 at 6:20 AM, Andreas <wiisses <at> web.de> wrote:
> Dear diff-team,
>
> this is not a bug but an idea for a diff option in further versions:
>
> Idea:
> comparison of two files by size only.
>
> why?
> makes comparison extremely fast; often no need to compare file contents
> to get a first hint whether there is a difference at all
>
> example:
> - uploading a folder with a bunch of files to a slow motion cloud;
> comparing each file by contents is very time consuming (...slow motion
> cloud)
> - as a first hint to find out about a possible difference could be the
> comparison of file size for each file uploaded with the local ones

Thanks for the suggestion, but diff already performs the optimization,
when possible, of detecting when two files have different sizes,
and in that case does not even bother to open
(much less read/compare) them.

If you want to simply compare file sizes, you can already
write a tiny shell/perl/python script to obtain and compare
those numbers, so I'm closing this auto-created "issue".
You're welcome to continue the discussion, which is being
archived at http://bugs.gnu.org/20250




Information forwarded to bug-diffutils <at> gnu.org:
bug#20250; Package diffutils. (Mon, 09 May 2016 15:40:01 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Andreas <wiisses <at> web.de>
Cc: 20250 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#20250: diff by size
Date: Mon, 9 May 2016 08:39:10 -0700
On Sun, May 8, 2016 at 9:36 PM, Jim Meyering <jim <at> meyering.net> wrote:
> tags 20250 notabug
> close 20250
> done
>
> On Fri, Apr 3, 2015 at 6:20 AM, Andreas <wiisses <at> web.de> wrote:
>> Dear diff-team,
>>
>> this is not a bug but an idea for a diff option in further versions:
>>
>> Idea:
>> comparison of two files by size only.
>>
>> why?
>> makes comparison extremely fast; often no need to compare file contents
>> to get a first hint whether there is a difference at all
>>
>> example:
>> - uploading a folder with a bunch of files to a slow motion cloud;
>> comparing each file by contents is very time consuming (...slow motion
>> cloud)
>> - as a first hint to find out about a possible difference could be the
>> comparison of file size for each file uploaded with the local ones
>
> Thanks for the suggestion, but diff already performs the optimization,
> when possible, of detecting when two files have different sizes,
> and in that case does not even bother to open
> (much less read/compare) them.

To clarify: the above is what happens when you use the --brief (-q) option.
It is obviously not the default.




This bug report was last modified 7 years and 325 days ago.

Previous Next


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