From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29121 invoked by alias); 23 Jan 2017 19:10:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40401 Received: (qmail 11171 invoked from network); 23 Jan 2017 19:10:35 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(-0.7/5.0):. Processed in 0.878834 secs); 23 Jan 2017 19:10:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=ERi jXMFKuFssX9Kcwv5W7Jt8maY=; b=vpvoKlQIZrMqWmc2m8+0+wheg4sz1cZ36H1 sJ2lwYGCzXlzc3aRnlxBHqdGche4jRYPDKLFv6fT/JwQlRcTx9KIQtsYRqfzp3V2 xrTmfCGRs2oDnxhz0rGrR/xJOZ87gUIhG72qsKVb/UYYA3lOZETS/KyvRoyJcl6i JScLdjyo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ER ijXMFKuFssX9Kcwv5W7Jt8maY=; b=QkUqugwSOONhDMEZDXyTLDg6h3p216CxQ4 ZfPYIIBLKZHujytoKSI1KwknmB9yUApMyRgSADON2ix+8fEt655JoZhuOeah5b51 91qob93zv0oR/ixL4Jw7G1hY2UD4ufEA9cpbeKkjERpJuBDa58oNKinmQXLaOxqA Wknd0PRqg= X-ME-Sender: X-Sasl-enc: en3G/A2MmbZ00C+vDUrcz3m9QD6+0Yq5c6mRTcJkY/QE 1485198629 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH] vcs_info git: Fix the %c patch-format expando. Date: Mon, 23 Jan 2017 19:06:39 +0000 Message-Id: <1485198399-23174-1-git-send-email-danielsh@fujitsu.shahaf.local2> X-Mailer: git-send-email 2.1.4 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]}" \