* [PATCH] zsh completion: 5.0.3 compat, use emulate
@ 2013-12-16 8:32 Phil Pennock
2014-04-30 6:03 ` Felipe Contreras
0 siblings, 1 reply; 4+ messages in thread
From: Phil Pennock @ 2013-12-16 8:32 UTC (permalink / raw)
To: git; +Cc: Felipe Contreras
The bash completion pulled into zsh was being pulled in _as_ zsh, but
used patterns which relied on falling through as unhandled. In zsh
5.0.3 this no longer works, resulting in:
__git_complete_remote_or_refspec:33: bad pattern: +*
Fix by telling zsh to emulate sh while sourcing the bash config file,
which stickily preserves compatibility options in the function context.
This usage of "emulate" came in with zsh 4.3.10, released 2009-06-01.
Signed-off-by: Phil Pennock <pdp@spodhuis.org>
---
nb: I am not on the git mailing-list, please keep me CC'd.
I have read SubmittingPatches but let me know if I've missed something.
Fix applies (unmodified) to both master and maint.
Thanks.
contrib/completion/git-completion.zsh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index fac5e71..d898b65 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -39,7 +39,7 @@ if [ -z "$script" ]; then
test -f $e && script="$e" && break
done
fi
-ZSH_VERSION='' . "$script"
+emulate sh -c 'ZSH_VERSION="" . "$script"'
__gitcomp ()
{
--
1.8.5.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] zsh completion: 5.0.3 compat, use emulate
2013-12-16 8:32 [PATCH] zsh completion: 5.0.3 compat, use emulate Phil Pennock
@ 2014-04-30 6:03 ` Felipe Contreras
2014-04-30 10:00 ` Felipe Contreras
0 siblings, 1 reply; 4+ messages in thread
From: Felipe Contreras @ 2014-04-30 6:03 UTC (permalink / raw)
To: Phil Pennock, git; +Cc: Felipe Contreras
Phil Pennock wrote:
> The bash completion pulled into zsh was being pulled in _as_ zsh, but
> used patterns which relied on falling through as unhandled. In zsh
> 5.0.3 this no longer works, resulting in:
>
> __git_complete_remote_or_refspec:33: bad pattern: +*
>
> Fix by telling zsh to emulate sh while sourcing the bash config file,
> which stickily preserves compatibility options in the function context.
> This usage of "emulate" came in with zsh 4.3.10, released 2009-06-01.
I'm using 5.9.5 and I don't see any issue. Howe exactly have you
configured this script?
> Signed-off-by: Phil Pennock <pdp@spodhuis.org>
> ---
> nb: I am not on the git mailing-list, please keep me CC'd.
No need to say that. This is a sane mailing list with doesn't do
reply-to munging[1], so you are Cc'ed by default, in essentially al
MUA's out there.
[1] http://felipec.wordpress.com/2010/08/03/avoid-reply-to-munging-mail-as-mail-was-meant-to-be/
--
Felipe Contreras
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] zsh completion: 5.0.3 compat, use emulate
2014-04-30 6:03 ` Felipe Contreras
@ 2014-04-30 10:00 ` Felipe Contreras
2014-04-30 19:44 ` Phil Pennock
0 siblings, 1 reply; 4+ messages in thread
From: Felipe Contreras @ 2014-04-30 10:00 UTC (permalink / raw)
To: Felipe Contreras, Phil Pennock, git; +Cc: Felipe Contreras
Felipe Contreras wrote:
> Phil Pennock wrote:
> > The bash completion pulled into zsh was being pulled in _as_ zsh, but
> > used patterns which relied on falling through as unhandled. In zsh
> > 5.0.3 this no longer works, resulting in:
> >
> > __git_complete_remote_or_refspec:33: bad pattern: +*
> >
> > Fix by telling zsh to emulate sh while sourcing the bash config file,
> > which stickily preserves compatibility options in the function context.
> > This usage of "emulate" came in with zsh 4.3.10, released 2009-06-01.
>
> I'm using 5.9.5 and I don't see any issue. Howe exactly have you
> configured this script?
I meant 5.0.5.
Anyway, I've tried with multiple versions of zsh and I'm able to
reproduce the issue by doing 'git push origin <tab>'. However, it seems
the issue was instroduced in 5.0.3, and fixed in 5.0.4, so I don't think
we should do anything on our side.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] zsh completion: 5.0.3 compat, use emulate
2014-04-30 10:00 ` Felipe Contreras
@ 2014-04-30 19:44 ` Phil Pennock
0 siblings, 0 replies; 4+ messages in thread
From: Phil Pennock @ 2014-04-30 19:44 UTC (permalink / raw)
To: Felipe Contreras; +Cc: git
On 2014-04-30 at 05:00 -0500, Felipe Contreras wrote:
> Felipe Contreras wrote:
> > Phil Pennock wrote:
> > > The bash completion pulled into zsh was being pulled in _as_ zsh, but
> > > used patterns which relied on falling through as unhandled. In zsh
> > > 5.0.3 this no longer works, resulting in:
> > >
> > > __git_complete_remote_or_refspec:33: bad pattern: +*
> > >
> > > Fix by telling zsh to emulate sh while sourcing the bash config file,
> > > which stickily preserves compatibility options in the function context.
> > > This usage of "emulate" came in with zsh 4.3.10, released 2009-06-01.
> >
> > I'm using 5.9.5 and I don't see any issue. Howe exactly have you
> > configured this script?
>
> I meant 5.0.5.
>
> Anyway, I've tried with multiple versions of zsh and I'm able to
> reproduce the issue by doing 'git push origin <tab>'. However, it seems
> the issue was instroduced in 5.0.3, and fixed in 5.0.4, so I don't think
> we should do anything on our side.
Correct: it was considered a regression and after I mailed the git list,
zsh changed the behaviour and put out 5.0.4 fairly shortly thereafter.
I don't think that 5.0.3 has taken root anywhere, so you should be good.
-Phil
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-04-30 20:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-16 8:32 [PATCH] zsh completion: 5.0.3 compat, use emulate Phil Pennock
2014-04-30 6:03 ` Felipe Contreras
2014-04-30 10:00 ` Felipe Contreras
2014-04-30 19:44 ` Phil Pennock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).