zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Fix hexdump command used for mercurial dirstate parsing
@ 2016-10-30  2:47 Reed Riley
  2016-10-30  5:34 ` Bart Schaefer
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Reed Riley @ 2016-10-30  2:47 UTC (permalink / raw)
  To: zsh-workers; +Cc: Reed Riley

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

Changing the command resolves the problem:
❯ xxd -p -l20 .hg/dirstate
77bba665e970146bd2be0b2da40092e340408804
---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index f35ad59..abcd8bc 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -42,7 +42,7 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
     if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" use-simple \
             && ( VCS_INFO_check_com hexdump ) && [[ -r ${dirstatefile} ]] ; then
         # Calling hexdump is (much) faster than hg but doesn't get the local rev
-        r_csetid=$(hexdump -n 20 -e '1/1 "%02x"' ${dirstatefile})
+        r_csetid=$(xxd -p -l20 ${dirstatefile})
     else
         # Settling for a short (but unique!) hash because getting the full
         # 40-char hash in addition to all the other info we want isn't
-- 
2.10.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-10-31 18:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-30  2:47 [PATCH] Fix hexdump command used for mercurial dirstate parsing Reed Riley
2016-10-30  5:34 ` Bart Schaefer
2016-10-30  7:01 ` Mikael Magnusson
2016-10-30 11:11 ` Frank Terbeck
2016-10-30 14:43   ` Reed Riley
2016-10-30 16:58     ` Reed Riley
2016-10-30 19:57       ` Frank Terbeck
2016-10-30 15:55   ` Daniel Shahaf
2016-10-30 17:06     ` Daniel Shahaf
2016-10-30 18:28       ` Bart Schaefer
2016-10-30 20:33         ` Daniel Shahaf
2016-10-31  9:04           ` Frank Terbeck
2016-10-31 18:37             ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).