Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix hexdump command used for mercurial dirstate parsing
- X-seq: zsh-workers 39771
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Reed Riley <john.reed.riley@xxxxxxxxx>
- Subject: Re: [PATCH] Fix hexdump command used for mercurial dirstate parsing
- Date: Sun, 30 Oct 2016 08:01:05 +0100
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3R+1wwgJ2psZJ2E4RrnrPe6eFLVvEKVsk60kwGeB0M4=; b=XWGrmb//GCSZnZzGTSv58mRdX21y9YPjiPJI8z8ViK8djfBQ/bwJFfd/4pd1NDbCwu 44n1mBc9LpCzli6K5yzoZ19PGor1TdPF2TBabZgP3tpIB2RHA/Wh6Y7GsvoxrqhTudWH 2Vh+mvbIW7mbRPqQ/5vhZPhLeFWW1uW3k9iYYQCN0RoZb7ttk20u7q9q3Ufo+G6bc+NV TxVEhaA/bHpurXudSpHu09uqJprxaJhzYqMDZclDj228ZLB16EJQVkfFjCQLhHkZUlTk qYZHj4I8L0Vo89ujLO9LFzwCLiCkjVa1AAyO9A1qiqmGOMGu/KbSJR/133SVD7XUexAa fRWA==
- In-reply-to: <20161030024723.62832-1-john.reed.riley@gmail.com>
- 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
- References: <20161030024723.62832-1-john.reed.riley@gmail.com>
On Sun, Oct 30, 2016 at 3:47 AM, Reed Riley <john.reed.riley@xxxxxxxxx> 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
>
> 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
I don't think it's a good idea to add a dependency on Vim here.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author