Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Fix hexdump command used for mercurial dirstate parsing



Hi,

Reed Riley wrote:
> Normally, the old command works.  But very rarely, it outputs a string
> like the following instead:
> ❯ hexdump -n20 -e '1/1 "%02x"' .hg/dirstate
> 77bba665e970146bd2be0b2da40092e340*
> 8804
[...]
> -        r_csetid=$(hexdump -n 20 -e '1/1 "%02x"' ${dirstatefile})
> +        r_csetid=$(xxd -p -l20 ${dirstatefile})

I would much rather know, what causes hexdump to behave like that. Is
the way we are using it documented behavior? If so, that would suggest a
bug in hexdump, that should be resolved instead. If no, we're probably
using hexdump in a wrong way — maybe just in a non-portable way, and we
should fix the way we're using hexdump.

Are you able to provides example data, that causes the bug? Maybe even
formulate a supposition as to what it is exactly, that triggers this
behaviour.

"xxd" is a command shipped with vim. Adding such a dependency is out of
the question for me. It would be conceivable to make the command that is
called in these places configurable via styles. But that is a separate
issue to the one that fixes our use of hexdump.


Regards, Frank



Messages sorted by: Reverse Date, Date, Thread, Author