zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH] vcs_info quilt: Avoid forks
Date: Fri, 29 Nov 2019 20:52:00 +0000	[thread overview]
Message-ID: <20191129205200.30690-1-danielsh@tarpaulin.shahaf.local2> (raw)

---
I added an entry to the list of incompatibilities in README because the
function is defined as
.
    (( ${+functions[VCS_INFO_quilt-dirfind]} )) ||
    function VCS_INFO_quilt-dirfind() {
.
, presumably so zshrc can override it.

Cheers,

Daniel


 Functions/VCS_Info/VCS_INFO_quilt | 10 +++++-----
 README                            |  4 ++++
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt
index 1f20e895d..fef85964a 100644
--- a/Functions/VCS_Info/VCS_INFO_quilt
+++ b/Functions/VCS_Info/VCS_INFO_quilt
@@ -78,7 +78,7 @@ function VCS_INFO_quilt-dirfind() {
     VCS_INFO_bydir_detect ${dir}
     ret=$?
     vcs_comm[detect_need_file]=${oldfile}
-    printf '%s' ${vcs_comm[basedir]}
+    REPLY=${vcs_comm[basedir]}
     vcs_comm[basedir]="${olddir}"
     return ${ret}
 }
@@ -113,8 +113,8 @@ function VCS_INFO_quilt-patch2subject() {
         ;;
     esac
 
-    pc="$(VCS_INFO_quilt-dirfind .pc .version)"
-    ret=$?
+    VCS_INFO_quilt-dirfind .pc .version
+    ret=$? pc=$REPLY
     if (( ret == 0 )); then
         [[ ${quiltmode} == 'standalone' ]] && root=${pc}
         pc=${pc}/.pc
@@ -138,8 +138,8 @@ function VCS_INFO_quilt-patch2subject() {
             zstyle -s "${context}" quilt-patch-dir patches || patches="${QUILT_PATCHES}"
             if [[ "${patches}" != /* ]]; then
                 tmp=${patches:-patches}
-                patches="$(VCS_INFO_quilt-dirfind "${tmp}")"
-                ret=$?
+                VCS_INFO_quilt-dirfind "${tmp}"
+                ret=$? patches=$REPLY
                 (( ret )) && return ${ret}
                 patches=${patches}/${tmp}
             else
diff --git a/README b/README
index be7929164..7ece48183 100644
--- a/README
+++ b/README
@@ -49,6 +49,10 @@ The behaviour of :h has similarly changed.
 The behaviour has also changed in forms such as ${foo:t2) and *(:t2),
 but in those cases the previous behaviour was not meaningful.
 
+The vcs_info function VCS_INFO_quilt-dirfind now returns a string value
+by setting $REPLY.  Previously it printed the value to standard output.
+This only affects you if you override that function in your dotfiles.
+
 Incompatibilities between 5.6.2 and 5.7.1
 -----------------------------------------
 

                 reply	other threads:[~2019-11-29 20:52 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=20191129205200.30690-1-danielsh@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --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).