Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _git: __git_files: do not pass $PREFIX to ls-files, breaks matcher-list
- X-seq: zsh-workers 38154
- From: m0viefreak <m0viefreak.cm@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _git: __git_files: do not pass $PREFIX to ls-files, breaks matcher-list
- Date: Sun, 13 Mar 2016 23:20:42 +0100
- Cc: m0viefreak <m0viefreak.cm@xxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=D/aa+s+Qtg9T3qxElFu7gPbnHzQ/KywF15lpQFvu96w=; b=GILtzJwGj0Y0w3yyPH8/hzuGIfmzGv58yDnYvebnk+iiOnrfB2fwvbSGxlIeG5l+N9 QLudDUz+oaUEXyj+WHSEZEHq75PKjLXHb5aOpQxE6FoYuViL2ZXLYdd3lSRpc1dgsKLo XdiPPwmRucYWfJpD0dQ63fl8fG6wJJ2JsY+zdFm8YGeVmQ3+wU2a9rdgID174F937iob 7dXhwUmGoNfjsdRoqeCu2DUAwzb0pYj8YlwtI55bFy5uU14R7TrinVBZj5pQRp9YRneD SwM8cOECfpxcln8x358XItKevO/QvJS5374453GhfRJWLcDSCJ29+aNKxNDvXxizUlpl tNyA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
When getting file lists from git-ls-files, do not pass the
typed $PREFIX, because this breaks the matcher-list zstyle.
There is no need to pre-filter the results that strictly when
calling ls-files, beause the results are passed to _multi_parts
which deals with that anyways.
Example:
- Modifications to files dir/FIRST.txt and dir/SECOND.txt in a git repo
- matcher-list zstyle set to ignore case: m:{a-z}={A-Z}
- Attempt to complete: git checkout -- dir/f<tab>
- Before this fix: git-ls-files is called
git ls-files -z --exclude-standard --modified -- 'dir/f*'
and returns nothing, because it does not know of zsh's matcher-list.
No completions are offered, even though matching should work
case-insensitively.
- After this fix: git-ls-files is called
git ls-files -z --exclude-standard --modified -- 'dir/*'
which returns (dir/FIRST.txt dir/SECOND.txt).
All results are then passed to _multi_parts which deals with the
actual completion, taking into account the matcher spec,
and correctly offers the matching result
FIRST.txt
---
Completion/Unix/Command/_git | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index c989a2c..858331d 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6034,7 +6034,7 @@ __git_files () {
# TODO: --directory should probably be added to $opts when --others is given.
- local pref=$gitcdup$gitprefix$PREFIX
+ local pref=$gitcdup$gitprefix
# First allow ls-files to pattern-match in case of remote repository
files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\\\*} 2>/dev/null)"})
--
2.5.0.234.gefc8a62
Messages sorted by:
Reverse Date,
Date,
Thread,
Author