Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 5.0.3 +* -> git completion regression
- X-seq: zsh-workers 32123
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: 5.0.3 +* -> git completion regression
- Date: Mon, 16 Dec 2013 05:37:26 -0500
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=lj+zzunx+aZuda6t9UJn7aaGLxQ0X272GtaB4ur0t6A=; b=oED7RlEOSk5VXNAm+Opn3pL3l44zTUOfOw9CZTw4lPQYaybL4vBlw6hrgI9owME1B1qQsfDDniyWj7BtB1LD0G8hDIfnOEtxPyarDQncRJN203V7kP/DBb3dOT7Hc5FsXMMcm+n2gPANIxleqEUQTHGXi+l2X7iyMgCcrzWWsSw=;
- In-reply-to: <20131216094700.2c5edd2a@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Peter Stephenson <p.stephenson@xxxxxxxxxxx>, zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: url=https://www.security.spodhuis.org/PGP/keys/0x3903637F.asc
- References: <20131216081436.GA23085@redoubt.spodhuis.org> <20131216094700.2c5edd2a@pwslap01u.europe.root.pri>
On 2013-12-16 at 09:47 +0000, Peter Stephenson wrote:
> On Mon, 16 Dec 2013 03:14:37 -0500
> Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> > % git push origin <TAB>
> > __git_complete_remote_or_refspec:33: bad pattern: +*
>
> I can't think of any circumstance where +* should be a bad pattern. Is
> this easy to reproduce in a simple example?
Finally managed it. It seems that the _git wrapper has a function
__git_zsh_bash_func() which does "emulate -L ksh" and somehow that
breaks when calling into the functions, while sourcing the file under
sticky sh emulation (via "emulate sh -c") overrides that ksh context and
fixes this.
% zsh -f
ilmenite% emulate ksh
ilmenite% case "$foo" in +*) echo snert;; esac
zsh: bad pattern: +*
%
I have git-1.8.5.1 from HomeBrew on a Mac, and zsh 5.0.3 from MacPorts
(yeah, mixing those two isn't great, but not relevant here). I used git
bisect to find the triggering commit in zsh, doing a
configure/make/make-install cycle with each, invoking that shell,
switching to a git repo dir and typing "git push origin <TAB>".
I didn't use "zsh -f" during that cycle, but for completeness:
% zsh -f
ilmenite% fpath=(/usr/local/share/zsh/site-functions $fpath)
ilmenite% autoload compinit ; compinit
ilmenite% cd ~/path/to/a/git/repo/
ilmenite% git push origin
__git_complete_remote_or_refspec:33: bad pattern: +*
ilmenite%
Without the fpath adjustment, I get the _git completion from zsh and
everything works fine. It's only the git-supplied zsh completion
configuration which breaks until I force emulation mode for the .bash
inclusion.
----------------------------8< cut here >8------------------------------
+__git_zsh_main:25> case arg (command)
+__git_zsh_main:25> case arg (arg)
+__git_zsh_main:33> local 'command=push' __git_dir
+__git_zsh_main:35> (( 0 ))
+__git_zsh_main:38> __git_dir=''·
+__git_zsh_main:41> (( 0 ))
+__git_zsh_main:43> words=( git push origin )·
+__git_zsh_main:45> __git_zsh_bash_func push
+__git_zsh_bash_func:2> emulate -L ksh
+__git_zsh_bash_func:4> local 'command=push'
+__git_zsh_bash_func:6> local 'completion_func=_git_push'
+__git_zsh_bash_func:7> declare -f _git_push
+__git_zsh_bash_func:7> _git_push
+_git_push:2> case origin (--repo)
+_git_push:7> case (--repo=*)
+_git_push:7> case (--*)
+_git_push:20> __git_complete_remote_or_refspec
+__git_complete_remote_or_refspec:2> local 'cur_=' 'cmd=push'
+__git_complete_remote_or_refspec:3> local i 'c=2' 'remote=' 'pfx=' 'lhs=1' 'no_complete_refspec=0'
+__git_complete_remote_or_refspec:4> [ push '=' remote ']'
+__git_complete_remote_or_refspec:7> [ 2 -lt 3 ']'
+__git_complete_remote_or_refspec:8> i=origin·
+__git_complete_remote_or_refspec:9> case origin (--mirror)
+__git_complete_remote_or_refspec:9> case origin (--all)
+__git_complete_remote_or_refspec:9> case origin (-*)
+__git_complete_remote_or_refspec:9> case origin (*)
+__git_complete_remote_or_refspec:21> remote=origin·
+__git_complete_remote_or_refspec:21> break
+__git_complete_remote_or_refspec:25> [ -z origin ']'
+__git_complete_remote_or_refspec:29> [ 0 '=' 1 ']'
+__git_complete_remote_or_refspec:32> [ origin '=' . ']'
+__git_complete_remote_or_refspec:33> case (*:*)
+__git_complete_remote_or_refspec:33> case (+*)
__git_complete_remote_or_refspec:33: bad pattern: +*
+_dispatch:64> [[ patterns == (all|*patterns*) ]]
+_dispatch:64> return ret
----------------------------8< cut here >8------------------------------
Messages sorted by:
Reverse Date,
Date,
Thread,
Author