GNU bug report logs - #37844
[PATCH] cmp -x/--verbose-hex

Previous Next

Package: diffutils;

Reported by: "dmo2118 <at> gmail.com" <dmo2118 <at> gmail.com>

Date: Mon, 21 Oct 2019 04:40:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 37844 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#37844; Package diffutils. (Mon, 21 Oct 2019 04:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "dmo2118 <at> gmail.com" <dmo2118 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Mon, 21 Oct 2019 04:40:02 GMT) Full text and rfc822 format available.

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

From: "dmo2118 <at> gmail.com" <dmo2118 <at> gmail.com>
To: bug-diffutils <at> gnu.org
Subject: [PATCH] cmp -x/--verbose-hex
Date: Sun, 20 Oct 2019 16:32:20 -0400
[Message part 1 (text/plain, inline)]
This adds a `-x`/`--verbose-hex` option to `cmp`, similar to what FreeBSD has in
its own `cmp`. From `doc/diffutils.texi`:

'-x'
'--verbose-hex'
     Like '--verbose', but with hexadecimal numbers, and byte numbers
     starting at 0.

A few assorted points:
* `cmp -x` always displays a minimum of eight hex digits, just like FreeBSD's
implementation.
* `offtostr` only does decimal, so it was removed in a few places where
hexadecimal was called for.
* Some of the format strings had `%s` replaced with `%"PRIuMAX"`, in part
because of GCC's new `-Wformat-overflow` feature. These strings are translated,
and because it was a simple fix, I updated the `.po` files.
* For `-x`, I replaced "EOF on FILE after byte 511" to "EOF on FILE at byte
0x200". I think it's a bit more useful this way.
* I believe the Malay (`ms.po`) translation needs a bit of attention at this
spot regarding the printf format string:
```
#: src/cmp.c:592
#, fuzzy, c-format
#| msgid "cmp: EOF on %s\n"
msgid "cmp: EOF on %s after byte %s\n"
msgstr "%s: EOF tidak dijangka selepas membaca %d/%d bins\n"
```

This is a bit more than the 15-or-so lines of code that are "not legally
significant for copyright", so let me know if there's paperwork that needs to be
filled out.

Dave Odell

[cmp-x-translations.patch (text/x-patch, attachment)]
[cmp-x.patch (text/x-patch, attachment)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#37844; Package diffutils. (Wed, 09 Jul 2025 03:32:02 GMT) Full text and rfc822 format available.

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

From: Dave Brand <dbrand10gnu <at> pegas.us>
To: bug-diffutils <at> gnu.org
Cc: dmo2118 <at> gmail.com
Subject: [bug-diffutils] bug#37844: [PATCH] cmp -x/--verbose-hex
Date: Mon, 7 Jul 2025 14:56:28 -0400
[Message part 1 (text/plain, inline)]
> This adds a `-x`/`--verbose-hex` option to `cmp`, similar to what FreeBSD has in
> its own `cmp`. From `doc/diffutils.texi`:
>
> '-x'
> '--verbose-hex'
>       Like '--verbose', but with hexadecimal numbers, and byte numbers
>       starting at 0.
>
> A few assorted points: ...
I was looking for the `-x` option today and saw it was still 
unimplemented 5 years after this patch. What is the proper channel to 
submit pull requests to this project?
[Message part 2 (text/html, inline)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#37844; Package diffutils. (Wed, 09 Jul 2025 21:09:03 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Dave Brand <dbrand10gnu <at> pegas.us>, 37844 <at> debbugs.gnu.org
Cc: dmo2118 <at> gmail.com
Subject: Re: [bug-diffutils] bug#37844: bug#37844: [PATCH] cmp -x/--verbose-hex
Date: Wed, 9 Jul 2025 14:08:44 -0700
On 2025-07-07 11:56, Dave Brand wrote:
>> This adds a `-x`/`--verbose-hex` option to `cmp`, similar to what 
>> FreeBSD has in
>> its own `cmp`. From `doc/diffutils.texi`:
>>
>> '-x'
>> '--verbose-hex'
>>       Like '--verbose', but with hexadecimal numbers, and byte numbers
>>       starting at 0.
>>
>> A few assorted points: ...
> I was looking for the `-x` option today and saw it was still 
> unimplemented 5 years after this patch. What is the proper channel to 
> submit pull requests to this project?
> 

I'd use "git format-patch" and "git send-email" to this address. If it's 
a nontrivial change we'll need to ask you for copyright papers.




This bug report was last modified 39 days ago.

Previous Next


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