Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Fix hexdump command used for mercurial dirstate parsing
- X-seq: zsh-workers 39767
- From: Reed Riley <john.reed.riley@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Fix hexdump command used for mercurial dirstate parsing
- Date: Sat, 29 Oct 2016 22:47:23 -0400
- Cc: Reed Riley <john.reed.riley@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QcBnVcHMBu4SpJxZo+aV1O5zydG5vJGJ93ia2lPGZas=; b=v3rpqAHLnd62AJU2ep0ck8xHs9+dYRYW71vDFpr4JukRRwBu3XuaoMzr6VOIokUgY8 0GkdohWFwdeSA0ZS/p2UPgH2+eY6hqmStDTyLm5yqDfRJyqB4EFEylEwWBz+aEPjoZbu fHwKxcjmpVq5fkpMhVDIFz9MtHxrXcE/oO9cG8kNqR3kQDBFW/3kA8KtpSrZ+9rZjzuF wmMsGVmHRHsgEvqpRCP/i9KhShdOePxZSNqEe5m5bHhrzJyzsps+ptITMkI6Crl9OAaO rvFfvy7AgY2lYGnA6WScRvjpFK5/Eama6U54YxL2xi0dhp2XwFJ3aplvn+41GbDDgwzP yFOg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author