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}" }