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

Re: Bug report; git tab-completion on macOS within paths containing unicode characters



This used to work in 5.7.1 (default shell on Catalina).  Then this
change was made:

-  local pref=$gitcdup$gitprefix$PREFIX
+  local pref=${(Q)${~PREFIX}}
+  [[ $pref[1] == '/' ]] || pref=$gittoplevel$gitprefix$pref

Unquoting the prefix with (Q) seems to have broken it.  That came from
workers/45313 ("revised version of workers/41523").  Daniel?

A different fix to try:

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 7370aaead..22b945e38 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -7531,7 +7531,7 @@ __git_files () {
   # First allow ls-files to pattern-match in case of remote repository. Use the
   # icase pathspec magic word to ensure that we support case-insensitive path
   # completion for users with the appropriate matcher configuration
-  files=(${(0)"$(_call_program files git ls-files -z
--exclude-standard ${(q)opts} -- ${(q)${pref:+:\(icase\)$pref\*}:-.}
2>/dev/null)"})
+  files=(${(0)"$(_call_program files git ls-files -z
--exclude-standard ${(q)opts} --
${(q)${pref:+:\(icase\)${(qq)pref}\*}:-.} 2>/dev/null)"})
   __git_command_successful $pipestatus || return

   # If ls-files succeeded but returned nothing, try again with no pattern. Note




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