GNU bug report logs - #19794
Feature Request - CMP

Previous Next

Package: diffutils;

Reported by: Pádraig Brady <P <at> draigBrady.com>

Date: Fri, 6 Feb 2015 17:13:01 UTC

Severity: wishlist

To reply to this bug, email your comments to 19794 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#19794; Package diffutils. (Fri, 06 Feb 2015 17:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pádraig Brady <P <at> draigBrady.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Fri, 06 Feb 2015 17:13:02 GMT) Full text and rfc822 format available.

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

From: Pádraig Brady <P <at> draigBrady.com>
To: Eric Blake <eblake <at> redhat.com>, Tyler Beaver <tyler9725 <at> gmail.com>
Cc: bug-diffutils <at> gnu.org, coreutils <at> gnu.org
Subject: Re: Feature Request - CMP
Date: Fri, 06 Feb 2015 17:12:09 +0000
On 06/02/15 17:07, Eric Blake wrote:
> On 02/06/2015 09:45 AM, Eric Blake wrote:
>> On 02/06/2015 09:23 AM, Pádraig Brady wrote:
>>> On 06/02/15 15:57, Tyler Beaver wrote:
>>>> I know this tool is probably note used as much anymore, but perhaps it would be worth adding a flag for overriding the verbose output number system for the values, or at any rate specifying that this output is in octal, and not decimal or hexadecimal.
>>>
>>> Currently: offsets are decimal, differing bytes are octal:
>>>
>>>   $ cmp -l <(echo 12345678abc) <(echo 12345678bbb)
>>>                     9 141 142
>>>                    11 143 142
> 
> Another observation: Note that when mixed with --ignore-initial, we
> behave as if offsets start from the point where we skipped to, rather
> than the beginning of the file.  Since -i is not required by POSIX, does
> this always make the most sense?
> 
> $ cmp -l     <(printf bbc) <(printf abd)
>                   1 142 141
>                   3 143 144
> $ cmp -l -i1 <(printf bbc) <(printf abd)
>                   2 143 144
> 
> and what happens when we use the two-offset form?
> 
> $ cmp -l -i2:1 <(printf abcd) <(printf bce)
>                   2 144 145
> $ cmp -l -i1:2 <(printf bce) <(printf abcd)
>                   2 145 144
> 
> 
>> That said, it might be worth patching 'cmp --help' to make it obvious
>> that differing bytes are in octal values.
> 
> That is, instead of
> 
>   -l, --verbose              output byte numbers and differing byte values
> 
> maybe we could use:
> 
>   -l, --verbose              for each difference, output the decimal
>                              offset and the differing octal values
> 
> Expanding that to two lines can be offset by compressing elsewhere:
> 
>   -i, --ignore-initial=SKIP         skip first SKIP bytes of both inputs
>   -i, --ignore-initial=SKIP1:SKIP2  skip first SKIP1 bytes of FILE1 and
>                                       first SKIP2 bytes of FILE2
> 
> feels long; how about:
> 
>   -i, --ignore-initial=SKIP[:SKIP2]  bypass SKIP bytes of FILE1, and
>                                      SKIP2 (default SKIP) bytes of FILE2

Good suggestions,
which I've CC'd the the appropriate list ;)

cheers,
Pádraig.




This bug report was last modified 10 years and 133 days ago.

Previous Next


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