From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7751 invoked by alias); 16 Feb 2016 10:49:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37997 Received: (qmail 1056 invoked from network); 16 Feb 2016 10:49:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Date: Tue, 16 Feb 2016 10:49:41 +0000 From: Daniel Shahaf To: Eric Cook Cc: zsh-workers@zsh.org Subject: Re: Bug in completion for git merge Message-ID: <20160216104941.GA16066@tarsus.local2> References: <6E7E611B-CA0B-4F79-B775-7D100CA9017B@gmail.com> <160215085854.ZM27144@torch.brasslantern.com> <8D34A413-897D-4D27-8FD4-4958FC0A90C4@gmail.com> <56C29140.304@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56C29140.304@gmx.com> User-Agent: Mutt/1.5.23 (2014-03-12) Eric Cook wrote on Mon, Feb 15, 2016 at 22:02:24 -0500: > On 02/15/2016 12:20 PM, Thomas Becker wrote: > > Ahh sorry about that. That explains some of the other weirdness I’ve been seeing. I’m trying to upgrade my completion to something that knows about newer git options than what is provided in 5.0.5. Is there any way to do that? Thanks. > > > By patching the completer to use portable syntax, portable in terms of zsh. > The following patch applied to master should work in pre 5.1. > > Considering that this is the only line in _git that expects the reserved word behavior, > it may be a good idea to commit it for consistency sake. But bart has a point. I added the backwards-incompatible line. I believe the decision to use a backwards-incompatible syntax was a conscious one: either because the issue had been discussed on-list, or because there had been precedent. I don't have a strong opinion regarding the specific patch. It's obviously correct. However, what should we do with the other instances of the backwards-incompatible syntax that are currently in Completion/ and Functions/? If we want to make $fpath backwards-compatible, we'd need to change all of them and stop adding new instances of backwards-incompatible syntaxes... which effectively means we'd stop eating our own dogfood. Perhaps a 'backwards-compatible $fpath' should live on a separate git branch, so users of master keep dogfooding. Cheers, Daniel > diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git > index b7eaf2e..fb10fa6 100644 > --- a/Completion/Unix/Command/_git > +++ b/Completion/Unix/Command/_git > @@ -1129,9 +1129,9 @@ _git-log () { > > (( $+functions[_git-merge] )) || > _git-merge () { > - local -a merge_options > + local -a merge_options git_commit_opts > __git_setup_merge_options > - local -a git_commit_opts=(--all --not HEAD --not) > + git_commit_opts=(--all --not HEAD --not) > > _arguments -w -S -s \ > $merge_options \ >