about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2018-10-07 17:46:43 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2018-10-08 13:44:40 +0000
commite38f15f8ff23651a8c4ef9fc394de7be93eb620f (patch)
treefa87450833bf6c64895d17aba85f34ea01263399 /Functions
parent31dcba76f07030f1a3c9f9ad6c41dbaf842eeb1a (diff)
downloadzsh-e38f15f8ff23651a8c4ef9fc394de7be93eb620f.tar.gz
zsh-e38f15f8ff23651a8c4ef9fc394de7be93eb620f.tar.xz
zsh-e38f15f8ff23651a8c4ef9fc394de7be93eb620f.zip
43620 (tweaked): vcs_info git: Reverse the order patches are passed to gen-unapplied-string in.
This is an incompatible change; see README for details.

Tweaks (relative to posted version): tweaked README, removed scalpel (debug print).
Diffstat (limited to 'Functions')
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git3
-rw-r--r--Functions/VCS_Info/VCS_INFO_set-patch-format2
2 files changed, 4 insertions, 1 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 8305cf41a..7ae2c0b27 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -123,8 +123,9 @@ VCS_INFO_git_getbranch () {
 (( ${+functions[VCS_INFO_git_handle_patches]} )) ||
 VCS_INFO_git_handle_patches () {
     local git_applied_s git_unapplied_s gitmsg
+    # All callers populate $git_patches_applied and $git_patches_unapplied in
+    # order, but the hook requires us to reverse $git_patches_applied.
     git_patches_applied=(${(Oa)git_patches_applied})
-    git_patches_unapplied=(${(Oa)git_patches_unapplied})
 
     VCS_INFO_set-patch-format 'git_patches_applied' 'git_applied_s' \
                               'git_patches_unapplied' 'git_unapplied_s' \
diff --git a/Functions/VCS_Info/VCS_INFO_set-patch-format b/Functions/VCS_Info/VCS_INFO_set-patch-format
index cdf2d303e..917ebf6bf 100644
--- a/Functions/VCS_Info/VCS_INFO_set-patch-format
+++ b/Functions/VCS_Info/VCS_INFO_set-patch-format
@@ -3,8 +3,10 @@
 #
 # Parameters:
 # $1 - name of an array parameter to be the argument to gen-applied-string
+#      (patches in reverse order)
 # $2 - name of a parameter to store the applied-string in
 # $3 - name of an array parameter to be the argument to gen-unapplied-string
+#      (patches in order)
 # $4 - name of a parameter to store the unapplied-string in
 # $5 - context argument for use in zstyle getters
 # $6 - name of a parameter to store a patch-format format string in