97e11051e2f8053b1d694788d1cb4b0dbb1e2365

Author
ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

chore(z): update to version 102fb780 (#13957)

* chore(z): update to 102fb780

* remove tests

* do not include tests

---------

Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>

Diff

This diff is truncated to protect this page.

  1diff --git a/.github/dependencies.yml b/.github/dependencies.yml
  2index b2440fa7ed2da10ab380448d9e5f2517cc5df646..96d9991a3a29fe2265bf1527a64aba7c7ff737f5 100644
  3--- a/.github/dependencies.yml
  4+++ b/.github/dependencies.yml
  5@@ -46,9 +46,10 @@ dependencies:
  6   plugins/z:
  7     branch: master
  8     repo: agkozak/zsh-z
  9-    version: acd0e1984df350c189f8f9c4956ec586b6c73fca
 10+    version: 102fb78036ed76feedf623907483691777a1d510
 11     precopy: |
 12       set -e
 13+      rm -r tests
 14       test -e README.md && mv -f README.md MANUAL.md
 15     postcopy: |
 16       set -e
 17diff --git a/plugins/z/MANUAL.md b/plugins/z/MANUAL.md
 18index 420535b275323683ed8f4655df5b38d1f1095552..1c8a1d222edeceb57df449811424efedad0c3cf5 100644
 19--- a/plugins/z/MANUAL.md
 20+++ b/plugins/z/MANUAL.md
 21@@ -2,20 +2,26 @@
 22 
 23 [![MIT License](img/mit_license.svg)](https://opensource.org/licenses/MIT)
 24 ![Zsh version 4.3.11 and higher](img/zsh_4.3.11_plus.svg)
 25+![Version](https://img.shields.io/github/v/release/agkozak/zsh-z)
 26+![Workflow Status](https://github.com/agkozak/zsh-z/actions/workflows/test.yml/badge.svg)
 27 [![GitHub stars](https://img.shields.io/github/stars/agkozak/zsh-z.svg)](https://github.com/agkozak/zsh-z/stargazers)
 28 
 29 ![Zsh-z demo](img/demo.gif)
 30 
 31diff --git a/plugins/z/_z b/plugins/z/_z
 32index a109841d6260c7e1bcb0e1dbd8ef866976a0da54..09e70af439ec81403b9339b03e041ca8ea1fbe20 100644
 33--- a/plugins/z/_z
 34+++ b/plugins/z/_z
 35@@ -1,6 +1,6 @@
 36 #compdef zshz ${ZSHZ_CMD:-${_Z_CMD:-z}}
 37 #
 38-# Zsh-z - jump around with Zsh - A native Zsh version of z without awk, sort,
 39+# Zsh-z - jump around with Zsh - A native Zsh version of rupa/z without awk, sort,
 40 # date, or sed
 41 #
 42 # https://github.com/agkozak/zsh-z
 43@@ -24,11 +24,7 @@
 44 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 45 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 46 # SOFTWARE.
 47-#
 48-# z (https://github.com/rupa/z) is copyright (c) 2009 rupa deadwyler and
 49-# licensed under the WTFPL license, Version 2.a
 50-#
 51-# shellcheck shell=ksh
 52+################################################################################
 53 
 54 ############################################################
 55 # Zsh-z COMPLETIONS
 56diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh
 57index 6df49822e24cd4ca876637408f7bd3d5cf3d31bd..d922fa77c288c1ab6c417f34721957ed7c5d3082 100644
 58--- a/plugins/z/z.plugin.zsh
 59+++ b/plugins/z/z.plugin.zsh
 60@@ -1,6 +1,6 @@
 61 ################################################################################
 62-# Zsh-z - jump around with Zsh - A native Zsh version of z without awk, sort,
 63-# date, or sed
 64+# Zsh-z - jump around with Zsh - A native Zsh version of rupa/z without awk,
 65+# sort, date, or sed
 66 #
 67 # https://github.com/agkozak/zsh-z
 68 #
 69@@ -24,9 +24,6 @@
 70 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 71 # SOFTWARE.
 72 #
 73-# z (https://github.com/rupa/z) is copyright (c) 2009 rupa deadwyler and
 74-# licensed under the WTFPL license, Version 2.
 75-#
 76 # Zsh-z maintains a jump-list of the directories you actually use.
 77 #
 78 # INSTALL:
 79@@ -57,22 +54,45 @@
 80 #   ZSHZ_COMPLETION -> completion method (default: 'frecent'; 'legacy' for
 81 #     alphabetic sorting)
 82 #   ZSHZ_DATA -> name of datafile (default: ~/.z)
 83+#   ZSHZ_DEBUG -> if set, turn on debugging aids: WARN_CREATE_GLOBAL while the
 84+#     command runs and per-function warnings (functions -W) at load time
 85+#     (default: unset)
 86+#   ZSHZ_ECHO -> if 1, print the directory name after jumping to it (default: 0)
 87 #   ZSHZ_EXCLUDE_DIRS -> array of directories to exclude from your database
 88 #     (default: empty)
 89 #   ZSHZ_KEEP_DIRS -> array of directories that should not be removed from the
 90 #     database, even if they are not currently available (default: empty)
 91+#   ZSHZ_LOCK_TIMEOUT -> seconds to wait for the lockfile before giving up
 92+#     (default: 1)
 93 #   ZSHZ_MAX_SCORE -> maximum combined score the database entries can have
 94 #     before beginning to age (default: 9000)
 95 #   ZSHZ_NO_RESOLVE_SYMLINKS -> '1' prevents symlink resolution
 96 #   ZSHZ_OWNER -> your username (if you want use Zsh-z while using sudo -s)
 97+#   ZSHZ_TILDE -> if 1, display ~ in place of the full $HOME path in output
 98+#     (default: 0)
 99+#   ZSHZ_TRAILING_SLASH -> if 1, a query ending in / matches at the end of a
100+#     directory path (default: 0)
101 #   ZSHZ_UNCOMMON -> if 1, do not jump to "common directories," but rather drop
102 #     subdirectories based on what the search string was (default: 0)
103 ################################################################################
104 
105-autoload -U is-at-least
106+# Minimalistic solution to allow this plugin to keep running under sh/bash/ksh
107+# emulation while continuing to use Zsh-only syntax features. `emulate zsh -c'
108+# evaluates its argument as code, so the script's own path -- `${(%):-%N}' --
109+# must be `${(q)}'-quoted; otherwise an install directory containing spaces or
110+# other shell-special characters (common on Cygwin/MSYS2 and macOS, where a
111+# home directory can be "C:\Users\John Smith" or "/Users/John Smith") would be
112+# word-split and the plugin would silently fail to re-source.
113+if [[ -o KSH_ARRAYS || -o SH_WORD_SPLIT ]]; then
114+  emulate zsh -c "source ${(q)${(%):-%N}}"
115+  return $?
116+fi
117+
118+autoload -Uz is-at-least
119 
120 if ! is-at-least 4.3.11; then
121-  print "Zsh-z requires Zsh v4.3.11 or higher." >&2 && exit
122+  print "Zsh-z requires Zsh v4.3.11 or higher." >&2
123+  return 1 2> /dev/null || exit 1
124 fi
125 
126 ############################################################
127@@ -99,6 +119,56 @@ With no ARGUMENT, list the directory history in ascending rank.
128     fold -s -w $(( COLUMNS > 0 ? COLUMNS : 80 )) >&2
129 }
130 
131+############################################################
132+# Canonicalize a path in the manner of `:A' -- normalize it
133+# lexically as `:a' does, then resolve symlinks -- without
134+# requiring any of the path to exist.
135+#
136+# `${x:A}' itself cannot be trusted with a missing path on
137+# Zsh 4.3.11: when the top-level component of $x does not
138+# exist (`/gone/sub'), the realpath machinery segfaults the
139+# shell (upstream bug, 4.3.11 only; deeper missing
140+# components are handled correctly on every version). So
141+# apply `:A' only to the deepest ancestor of the path that
142+# exists -- `:A' on an existing path is safe everywhere --
143+# and reattach the missing components verbatim. That
144+# reproduces `:A' exactly: `:A' resolves the symlinks in the
145+# existing prefix and carries the nonexistent tail
146+# unchanged, and the tail cannot contain live symlinks
147+# precisely because it does not exist. (A broken symlink
148+# stops the ancestor walk without being resolved -- `-e'
149+# fails on one -- which also matches `:A', which leaves
150+# broken symlinks unresolved.)
151+#
152+# Arguments:
153+#   $1 The path to canonicalize
154+#
155+# Returns the canonical path in $REPLY.
156+############################################################
157+_zshz_realpath() {
158+  local dir=${1:a}
159+  local -a tail