zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] vcs_info git: Fix the %c patch-format expando.
@ 2017-01-23 19:06 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2017-01-23 19:06 UTC (permalink / raw)
  To: zsh-workers

Before this change, ${git_unapplied_s} was unused and the %c
(${hook_com[unapplied]}) expando evaluated to the number of digits in
the string returned by the gen-unapplied-string hook (or to the number
of digits in the number of unapplied patches, when there was no such
hook).
---

I've noticed that the *-n hook_com keys are undocumented, but leaving that for
another day...

Cheers,

Daniel

 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 4ec87c6..efb77b7 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -136,9 +136,9 @@ VCS_INFO_git_handle_patches () {
     fi
     hook_com=()
     if VCS_INFO_hook 'gen-unapplied-string' "${git_patches_unapplied[@]}"; then
-        git_patches_unapplied=${#git_patches_unapplied}
+        git_unapplied_s=${#git_patches_unapplied}
     else
-        git_patches_unapplied=${hook_com[unapplied-string]}
+        git_unapplied_s=${hook_com[unapplied-string]}
     fi
 
     if (( ${#git_patches_applied} )); then
@@ -146,7 +146,7 @@ VCS_INFO_git_handle_patches () {
     else
         zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" nopatch-format gitmsg || gitmsg="no patch applied"
     fi
-    hook_com=( applied "${git_applied_s}"     unapplied "${git_patches_unapplied}"
+    hook_com=( applied "${git_applied_s}"     unapplied "${git_unapplied_s}"
                applied-n ${#git_patches_applied} unapplied-n ${#git_patches_unapplied} all-n ${git_all} )
     if VCS_INFO_hook 'set-patch-format' "${gitmsg}"; then
         zformat -f gitmisc "${gitmsg}" "p:${hook_com[applied]}" "u:${hook_com[unapplied]}" \


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-23 19:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-23 19:06 [PATCH] vcs_info git: Fix the %c patch-format expando Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).