zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: PATCH: vcs_info: just set the parameters instead of passing over a pipe
Date: Sun, 10 Mar 2013 13:57:45 +0100	[thread overview]
Message-ID: <1362920265-6420-1-git-send-email-mikachu@gmail.com> (raw)

All VCS_INFO_* functions are for internal use only, so nobody should be affected by this.

---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 787e763..3f643a2 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -5,10 +5,10 @@
 setopt localoptions extendedglob NO_shwordsplit
 local gitdir gitbase gitbranch gitaction gitunstaged gitstaged gitsha1
 local stgitpatch stgitunapplied
-local -xA hook_com
+local -A hook_com
 
 VCS_INFO_git_getaction () {
-    local gitaction='' gitdir=$1
+    local gitdir=$1
     local tmp
 
     for tmp in "${gitdir}/rebase-apply" \
@@ -22,7 +22,6 @@ VCS_INFO_git_getaction () {
             else
                 gitaction="am/rebase"
             fi
-            printf '%s' ${gitaction}
             return 0
         fi
     done
@@ -30,7 +29,7 @@ VCS_INFO_git_getaction () {
     for tmp in "${gitdir}/rebase-merge/interactive" \
                "${gitdir}/.dotest-merge/interactive" ; do
         if [[ -f "${tmp}" ]] ; then
-            printf '%s' "rebase-i"
+            gitaction="rebase-i"
             return 0
         fi
     done
@@ -38,18 +37,18 @@ VCS_INFO_git_getaction () {
     for tmp in "${gitdir}/rebase-merge" \
                "${gitdir}/.dotest-merge" ; do
         if [[ -d "${tmp}" ]] ; then
-            printf '%s' "rebase-m"
+            gitaction="rebase-m"
             return 0
         fi
     done
 
     if [[ -f "${gitdir}/MERGE_HEAD" ]] ; then
-        printf '%s' "merge"
+        gitaction="merge"
         return 0
     fi
 
     if [[ -f "${gitdir}/BISECT_LOG" ]] ; then
-        printf '%s' "bisect"
+        gitaction="bisect"
         return 0
     fi
 
@@ -59,7 +58,6 @@ VCS_INFO_git_getaction () {
         else
             gitaction=cherry
         fi
-        printf '%s' ${gitaction}
         return 0
     fi
 
@@ -67,7 +65,7 @@ VCS_INFO_git_getaction () {
 }
 
 VCS_INFO_git_getbranch () {
-    local gitbranch gitdir=$1 tmp actiondir
+    local gitdir=$1 tmp actiondir
     local gitsymref="${vcs_comm[cmd]} symbolic-ref HEAD"
 
     actiondir=''
@@ -106,12 +104,11 @@ VCS_INFO_git_getbranch () {
         fi
     fi
 
-    printf '%s' "${gitbranch}"
     return 0
 }
 
 gitdir=${vcs_comm[gitdir]}
-gitbranch="$(VCS_INFO_git_getbranch ${gitdir})"
+VCS_INFO_git_getbranch ${gitdir}
 if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then
     gitsha1=$(${vcs_comm[cmd]} rev-parse --quiet --verify HEAD)
 else
@@ -134,7 +131,7 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" && \
 fi
 
 VCS_INFO_adjust
-gitaction="$(VCS_INFO_git_getaction ${gitdir})"
+VCS_INFO_git_getaction ${gitdir}
 gitbase=${PWD%/${$( ${vcs_comm[cmd]} rev-parse --show-prefix )%/##}}
 rrn=${gitbase:t}
 
-- 
1.7.10.GIT


                 reply	other threads:[~2013-03-10 12:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362920265-6420-1-git-send-email-mikachu@gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).