1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

45543: vcs_info quilt: Allow quiltcommand to be a function.

Before this commit, it could only be an external command.
This commit is contained in:
Daniel Shahaf 2020-03-12 18:15:45 +00:00
parent 8e128afb2c
commit 5a1f5cf8ab
3 changed files with 11 additions and 2 deletions

View file

@ -1,5 +1,8 @@
2020-03-15 Daniel Shahaf <danielsh@apache.org>
* 45543: Functions/VCS_Info/VCS_INFO_quilt, README: vcs_info
quilt: Allow quiltcommand to be a function.
* 45547: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
vcs_info git: In interactive rebases, process
gen-unapplied-string arguments like gen-applied-string arguments

View file

@ -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=()

5
README
View file

@ -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
-----------------------------