From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25541 invoked by alias); 11 Jan 2014 07:37:41 -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: 18312 Received: (qmail 12930 invoked from network); 11 Jan 2014 07:37:25 -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: <140110233725.ZM22285@torch.brasslantern.com> Date: Fri, 10 Jan 2014 23:37:25 -0800 In-reply-to: <140110213433.ZM22191@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Approximate file path completion for git?" (Jan 10, 9:34pm) References: <140110213433.ZM22191@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, 9:34pm, Bart Schaefer wrote: } } Hmm, this looks as though it may have been broken by workers/31159 } } Probably what we need here is either a zstyle to let the user choose } whether path completion works, or to simply attempt ls-files a second } time without the prefix if the first attempt doesn't give any results. Here's a third possibility that occurred to me. This backs out 31159 and then adds the no_nomatch option when running git ls-files. Maybe that satisfies Torstein's issues? It restores partial path completion in some cases that I found to be failing before. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 43a01d9..9e364c8 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)"$(setopt no_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 -