From ad47c2d9078232d4a515b6dac2c5a8a8b05b16e9 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 12 Jul 2020 13:04:50 +0000 Subject: unposted (cf. GitHub #11): vcs_info hg: docs: Change an example to not use a hex dump incantation that may replace some bytes' values with asterisks. Discussion: https://github.com/zsh-users/zsh/pull/11#issuecomment-457970494 et seq Incidentally, GitHub #11 is also where workers/39786 (commit zsh-5.2-578-g74aa45910) was first reported. --- ChangeLog | 4 ++++ Misc/vcs_info-examples | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93894f290..725dc963b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-07-12 Daniel Shahaf + * unposted (cf. GitHub #11): Misc/vcs_info-examples: vcs_info + hg: docs: Change an example to not use a hex dump incantation + that may replace some bytes' values with asterisks. + * users/24985: Doc/Zsh/expn.yo: Clarify documentation of the ${(n)} and ${(-)} parameter expansion flags, and add a forward compatibility hatch to the latter. diff --git a/Misc/vcs_info-examples b/Misc/vcs_info-examples index 456b3a85b..6cf87f5f8 100644 --- a/Misc/vcs_info-examples +++ b/Misc/vcs_info-examples @@ -138,7 +138,7 @@ zstyle ':vcs_info:git*' formats "(%s)-[%12.12i %b]-" # hash & branch ### Fetch the full 40-character Mercurial revision id # There is no great way to obtain branch, local rev, and untracked changes in # addition to the full 40-character global rev id with a single invocation of -# Mercurial. This hook obtains the full global rev id using hexdump (in the +# Mercurial. This hook obtains the full global rev id using xxd(1) (in the # same way the use-simple flag does) while retaining all the other vcs_info # default functionality and information. zstyle ':vcs_info:hg*+set-message:*' hooks hg-fullglobalrev @@ -146,7 +146,7 @@ zstyle ':vcs_info:hg*+set-message:*' hooks hg-fullglobalrev # Output the full 40-char global rev id function +vi-hg-fullglobalrev() { local dirstatefile="${hook_com[base]}/.hg/dirstate" - local grevid="$(hexdump -n 20 -e '1/1 "%02x"' ${dirstatefile})" + local grevid="$(xxd -p -l 20 < ${dirstatefile})" # Omit %h from your hgrevformat since it will be included below hook_com[revision]="${hook_com[revision]} ${grevid}" } -- cgit 1.4.1