From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RDNS_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: (qmail 11137 invoked from network); 12 Mar 2020 18:16:27 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from unknown (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTP; 12 Mar 2020 18:16:27 -0000 Received: (qmail 812 invoked by alias); 12 Mar 2020 18:16:22 -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: List-Unsubscribe: X-Seq: 45543 Received: (qmail 13899 invoked by uid 1010); 12 Mar 2020 18:16:22 -0000 X-Qmail-Scanner-Diagnostics: from out3-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25744. spamassassin: 3.4.2. Clear:RC:0(66.111.4.27):SA:0(-1.9/5.0):. Processed in 0.82854 secs); 12 Mar 2020 18:16:22 -0000 X-Envelope-From: danielsh@apache.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: softfail (ns1.primenet.com.au: transitioning SPF record at amazonses.com does not designate 66.111.4.27 as permitted sender) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvhedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkedttd ertddtnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceouggrnhhivghlshhhsegr phgrtghhvgdrohhrgheqnecukfhppeejledrudejiedrheelrdduhedvnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepuggrnhhivghlshhhsegr phgrtghhvgdrohhrgh X-ME-Proxy: From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH] vcs_info quilt: Allow quiltcommand to be a function. Date: Thu, 12 Mar 2020 18:15:45 +0000 Message-Id: <20200312181545.8865-1-danielsh@tarpaulin.shahaf.local2> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Qmail-Scanner-2.11: added fake Content-Type header Content-Type: text/plain Before this commit, it could only be an external command. --- Functions/VCS_Info/VCS_INFO_quilt | 5 +++-- README | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt index fef85964a..264dbed0e 100644 --- a/Functions/VCS_Info/VCS_INFO_quilt +++ b/Functions/VCS_Info/VCS_INFO_quilt @@ -133,7 +133,7 @@ function VCS_INFO_quilt-patch2subject() { # This zstyle call needs to be moved further up if `quilt' needs # to be run in more places than this one. zstyle -s "${context}" quiltcommand quiltcommand || quiltcommand='quilt' - quilt_env=(env) + quilt_env=() if [ -z "$patches" ]; then zstyle -s "${context}" quilt-patch-dir patches || patches="${QUILT_PATCHES}" if [[ "${patches}" != /* ]]; then @@ -147,7 +147,8 @@ function VCS_INFO_quilt-patch2subject() { fi quilt_env+=(QUILT_PATCHES="$patches") fi - unapplied=( ${(f)"$(${quilt_env[@]} $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} ) + unapplied=( ${(f)"$(if (( $+quilt_env[1] )); then export ${quilt_env[@]}; fi + $quiltcommand --quiltrc /dev/null unapplied 2> /dev/null)"} ) unapplied=( ${unapplied:#} ) else unapplied=() diff --git a/README b/README index b8dfd0e2a..2bd5c2179 100644 --- a/README +++ b/README @@ -38,6 +38,11 @@ Build-time change: The default value of the --enable-gdbm configure argument has changed from "yes" to "no". Thus, the zsh/db/gdbm module will not be built unless --enable-gdbm is passed explicitly. +vcs_info quilt: The value of the 'quiltcommand' style used to be taken for the +name of an external command. Now it may also be a shell function. Normal +command word precedece rules apply, so if you have a function and a command +with the same name, the function will be used. + Incompatibilities since 5.7.1 -----------------------------