From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26110 invoked by alias); 11 Jan 2014 17:58:22 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18314 Received: (qmail 26158 invoked from network); 11 Jan 2014 17:58:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140111095818.ZM14468@torch.brasslantern.com> Date: Sat, 11 Jan 2014 09:58:18 -0800 In-reply-to: <140110233725.ZM22285@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Approximate file path completion for git?" (Jan 10, 11:37pm) References: <140110213433.ZM22191@torch.brasslantern.com> <140110233725.ZM22285@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Approximate file path completion for git? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 10, 11:37pm, Bart Schaefer wrote: } } - files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\\\*} 2>/dev/null)"}) } + files=(${(0)"$(setopt no_nomatch; _call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\*} 2>/dev/null)"}) That needs nullglob turned off as well. Here's a corrected patch: diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 43a01d9..e9a5318 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5683,7 +5683,7 @@ __git_files () { # TODO: --directory should probably be added to $opts when --others is given. local pref=$gitcdup$gitprefix$PREFIX - files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\\\*} 2>/dev/null)"}) + files=(${(0)"$(unsetopt nullglob nomatch; _call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\*} 2>/dev/null)"}) __git_command_successful $pipestatus || return # _wanted $tag expl $description _files -g '{'${(j:,:)files}'}' $compadd_opts -