mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-12-29 16:25:35 +01:00
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.
This commit is contained in:
parent
7dfc4f754e
commit
ad47c2d907
2 changed files with 6 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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}"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue