Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 4/4] vcs_info git: Reverse the order patches are passed to gen-unapplied-string in.



This is an incompatible change; see README for details.
---
 Doc/Zsh/contrib.yo                                | 2 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 4 +++-
 Functions/VCS_Info/VCS_INFO_set-patch-format      | 2 ++
 README                                            | 9 ++++++++-
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 9e4e6bc8f..d32ba018d 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -1668,7 +1668,7 @@ tt(mq)) backend and in tt(quilt) support when the tt(unapplied-string) is
 generated; the tt(get-unapplied) style must be true.
 
 This hook gets the names of all unapplied patches which tt(vcs_info)
-collected so far in the opposite order, which means that the first argument is
+collected so far in order, which means that the first argument is
 the patch next-in-line to be applied and so forth.
 
 When setting tt(ret) to non-zero, the string in
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 8305cf41a..a5cd5d861 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -123,8 +123,10 @@ 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})
+    typeset -p1 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
diff --git a/README b/README
index c792d4075..bff59a468 100644
--- a/README
+++ b/README
@@ -10,7 +10,7 @@ This is version 5.6.2 of the shell.  This is a bugfix release, following
 release.
 
 Note in particular the changes highlighted under "Incompatibilities since
-5.5.1" below.  See NEWS for more information.
+5.6.2" below.  See NEWS for more information.
 
 Installing Zsh
 --------------
@@ -31,6 +31,13 @@ Zsh is a shell with lots of features.  For a list of some of these, see the
 file FEATURES, and for the latest changes see NEWS.  For more
 details, see the documentation.
 
+Incompatibilities since 5.6.2
+-----------------------------
+
+vcs_info git: The gen-unapplied-string hook receives the patches in order (next
+to be applied first).  This is consistent with the hg backend and with one of
+two contradictory claims in the documentation (the other one has been corrected).
+
 Incompatibilities since 5.5.1
 -----------------------------
 



Messages sorted by: Reverse Date, Date, Thread, Author