{"thread":{"id":"35532","subject":"[PATCH] zsh completion: 5.0.3 compat, use emulate","startedAt":"2013-12-16T08:32:25Z","lastAt":"2014-04-30T19:44:29Z","messageCount":4,"participants":["Phil Pennock","Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"232048","messageId":"EMXW5CZ-001FUQ-3S@ilmenite.field.spodhuis.org","threadId":"35532","inReplyTo":null,"subject":"[PATCH] zsh completion: 5.0.3 compat, use emulate","fromName":"Phil Pennock","fromEmail":"pdp@spodhuis.org","sentAt":"2013-12-16T08:32:25Z","receivedAt":"2013-12-16T08:32:25Z","isPatch":true,"sender":{"key":"pdp@spodhuis.org","avatar":null},"body":"The bash completion pulled into zsh was being pulled in _as_ zsh, but\nused patterns which relied on falling through as unhandled.  In zsh\n5.0.3 this no longer works, resulting in:\n\n    __git_complete_remote_or_refspec:33: bad pattern: +*\n\nFix by telling zsh to emulate sh while sourcing the bash config file,\nwhich stickily preserves compatibility options in the function context.\nThis usage of \"emulate\" came in with zsh 4.3.10, released 2009-06-01.\n\nSigned-off-by: Phil Pennock <pdp@spodhuis.org>\n---\nnb: I am not on the git mailing-list, please keep me CC'd.\n    I have read SubmittingPatches but let me know if I've missed something.\n    Fix applies (unmodified) to both master and maint.\n    Thanks.\n\n contrib/completion/git-completion.zsh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh\nindex fac5e71..d898b65 100644\n--- a/contrib/completion/git-completion.zsh\n+++ b/contrib/completion/git-completion.zsh\n@@ -39,7 +39,7 @@ if [ -z \"$script\" ]; then\n \t\ttest -f $e && script=\"$e\" && break\n \tdone\n fi\n-ZSH_VERSION='' . \"$script\"\n+emulate sh -c 'ZSH_VERSION=\"\" . \"$script\"'\n \n __gitcomp ()\n {\n-- \n1.8.5.1\n"},{"id":"240270","messageId":"53609249b388d_597a125b3084d@nysa.notmuch","threadId":"35532","inReplyTo":"EMXW5CZ-001FUQ-3S@ilmenite.field.spodhuis.org","subject":"RE: [PATCH] zsh completion: 5.0.3 compat, use emulate","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T06:03:53Z","receivedAt":"2014-04-30T06:03:53Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Phil Pennock wrote:\n> The bash completion pulled into zsh was being pulled in _as_ zsh, but\n> used patterns which relied on falling through as unhandled.  In zsh\n> 5.0.3 this no longer works, resulting in:\n> \n>     __git_complete_remote_or_refspec:33: bad pattern: +*\n> \n> Fix by telling zsh to emulate sh while sourcing the bash config file,\n> which stickily preserves compatibility options in the function context.\n> This usage of \"emulate\" came in with zsh 4.3.10, released 2009-06-01.\n\nI'm using 5.9.5 and I don't see any issue. Howe exactly have you\nconfigured this script?\n\n> Signed-off-by: Phil Pennock <pdp@spodhuis.org>\n> ---\n> nb: I am not on the git mailing-list, please keep me CC'd.\n\nNo need to say that. This is a sane mailing list with doesn't do\nreply-to munging[1], so you are Cc'ed by default, in essentially al\nMUA's out there.\n\n[1] http://felipec.wordpress.com/2010/08/03/avoid-reply-to-munging-mail-as-mail-was-meant-to-be/\n\n-- \nFelipe Contreras\n"},{"id":"240287","messageId":"5360c9d095f5c_47db12fd310ef@nysa.notmuch","threadId":"35532","inReplyTo":"53609249b388d_597a125b3084d@nysa.notmuch","subject":"RE: [PATCH] zsh completion: 5.0.3 compat, use emulate","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T10:00:48Z","receivedAt":"2014-04-30T10:00:48Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Felipe Contreras wrote:\n> Phil Pennock wrote:\n> > The bash completion pulled into zsh was being pulled in _as_ zsh, but\n> > used patterns which relied on falling through as unhandled.  In zsh\n> > 5.0.3 this no longer works, resulting in:\n> > \n> >     __git_complete_remote_or_refspec:33: bad pattern: +*\n> > \n> > Fix by telling zsh to emulate sh while sourcing the bash config file,\n> > which stickily preserves compatibility options in the function context.\n> > This usage of \"emulate\" came in with zsh 4.3.10, released 2009-06-01.\n> \n> I'm using 5.9.5 and I don't see any issue. Howe exactly have you\n> configured this script?\n\nI meant 5.0.5.\n\nAnyway, I've tried with multiple versions of zsh and I'm able to\nreproduce the issue by doing 'git push origin <tab>'. However, it seems\nthe issue was instroduced in 5.0.3, and fixed in 5.0.4, so I don't think\nwe should do anything on our side.\n\n-- \nFelipe Contreras\n"},{"id":"240362","messageId":"20140430194429.GC85829@redoubt.spodhuis.org","threadId":"35532","inReplyTo":"5360c9d095f5c_47db12fd310ef@nysa.notmuch","subject":"Re: [PATCH] zsh completion: 5.0.3 compat, use emulate","fromName":"Phil Pennock","fromEmail":"phil.pennock@spodhuis.org","sentAt":"2014-04-30T19:44:29Z","receivedAt":"2014-04-30T19:44:29Z","isPatch":true,"sender":{"key":"phil.pennock@spodhuis.org","avatar":null},"body":"On 2014-04-30 at 05:00 -0500, Felipe Contreras wrote:\n> Felipe Contreras wrote:\n> > Phil Pennock wrote:\n> > > The bash completion pulled into zsh was being pulled in _as_ zsh, but\n> > > used patterns which relied on falling through as unhandled.  In zsh\n> > > 5.0.3 this no longer works, resulting in:\n> > > \n> > >     __git_complete_remote_or_refspec:33: bad pattern: +*\n> > > \n> > > Fix by telling zsh to emulate sh while sourcing the bash config file,\n> > > which stickily preserves compatibility options in the function context.\n> > > This usage of \"emulate\" came in with zsh 4.3.10, released 2009-06-01.\n> > \n> > I'm using 5.9.5 and I don't see any issue. Howe exactly have you\n> > configured this script?\n> \n> I meant 5.0.5.\n> \n> Anyway, I've tried with multiple versions of zsh and I'm able to\n> reproduce the issue by doing 'git push origin <tab>'. However, it seems\n> the issue was instroduced in 5.0.3, and fixed in 5.0.4, so I don't think\n> we should do anything on our side.\n\nCorrect: it was considered a regression and after I mailed the git list,\nzsh changed the behaviour and put out 5.0.4 fairly shortly thereafter.\nI don't think that 5.0.3 has taken root anywhere, so you should be good.\n\n-Phil\n"}]}