about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2020-07-12 13:04:50 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2020-07-12 13:06:38 +0000
commitad47c2d9078232d4a515b6dac2c5a8a8b05b16e9 (patch)
tree233c7ab957d391b5f51c81447e0ed7e0af2aa110
parent7dfc4f754e8c5033e43ddfdd7b6141cdbe11341e (diff)
downloadzsh-ad47c2d9078232d4a515b6dac2c5a8a8b05b16e9.tar.gz
zsh-ad47c2d9078232d4a515b6dac2c5a8a8b05b16e9.tar.xz
zsh-ad47c2d9078232d4a515b6dac2c5a8a8b05b16e9.zip
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.
-rw-r--r--ChangeLog4
-rw-r--r--Misc/vcs_info-examples4
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  <d.s@daniel.shahaf.name>
 
+	* 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}"
 }