{"thread":{"id":"35872","subject":"[PATCH] git-completion.zsh: do not clobber complete()","startedAt":"2014-02-14T21:24:00Z","lastAt":"2014-04-30T10:02:31Z","messageCount":3,"participants":["Mark Lodato","Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"234817","messageId":"1392413040-28436-1-git-send-email-lodato@google.com","threadId":"35872","inReplyTo":null,"subject":"[PATCH] git-completion.zsh: do not clobber complete()","fromName":"Mark Lodato","fromEmail":"lodato@google.com","sentAt":"2014-02-14T21:24:00Z","receivedAt":"2014-02-14T21:24:00Z","isPatch":true,"sender":{"key":"lodato@google.com","avatar":null},"body":"Previously, git-completion.zsh redefined complete() to make __git_complete()\na no-op. This broke zsh's built-in bash completion compatibility layer\n(bashcompinit), which defines its own complete().\n\nSadly, since there is no way in zsh to restore the original defintion of\ncomplete() after bash-completion.bash is sourced, we must pass in a flag to\ngit-completion.bash to change its behavior.\n\nSigned-off-by: Mark Lodato <lodato@google.com>\n---\n contrib/completion/git-completion.bash | 1 +\n contrib/completion/git-completion.zsh  | 8 +-------\n 2 files changed, 2 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9525343..36aa8bb 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2650,6 +2650,7 @@ __git_func_wrap ()\n # This is NOT a public function; use at your own risk.\n __git_complete ()\n {\n+\t[[ -n $GIT_DO_NOT_CALL_COMPLETE ]] && return\n \tlocal wrapper=\"__git_wrap${2}\"\n \teval \"$wrapper () { __git_func_wrap $2 ; }\"\n \tcomplete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \\\ndiff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh\nindex 6b77968..9f68d63 100644\n--- a/contrib/completion/git-completion.zsh\n+++ b/contrib/completion/git-completion.zsh\n@@ -16,12 +16,6 @@\n #\n #  fpath=(~/.zsh $fpath)\n \n-complete ()\n-{\n-\t# do nothing\n-\treturn 0\n-}\n-\n zstyle -T ':completion:*:*:git:*' tag-order && \\\n \tzstyle ':completion:*:*:git:*' tag-order 'common-commands'\n \n@@ -39,7 +33,7 @@ if [ -z \"$script\" ]; then\n \t\ttest -f $e && script=\"$e\" && break\n \tdone\n fi\n-ZSH_VERSION='' . \"$script\"\n+GIT_DO_NOT_CALL_COMPLETE=1 ZSH_VERSION='' . \"$script\"\n \n __gitcomp ()\n {\n-- \n1.9.0.rc1.175.g0b1dcb5\n"},{"id":"240269","messageId":"5360911d8fb6e_597a125b30828@nysa.notmuch","threadId":"35872","inReplyTo":"1392413040-28436-1-git-send-email-lodato@google.com","subject":"RE: [PATCH] git-completion.zsh: do not clobber complete()","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T05:58:53Z","receivedAt":"2014-04-30T05:58:53Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Mark Lodato wrote:\n> Previously, git-completion.zsh redefined complete() to make\n> __git_complete() a no-op. This broke zsh's built-in bash completion\n> compatibility layer (bashcompinit), which defines its own complete().\n\nHow exactly? I'm testing this and I don't see any problems. I run\n'type -f _complete' and I get bashcompinit's complete, and the internal\n_complete() function is used only by the _git completion.\n\nHow have you configured this completion? Are you using the recommended\ninstructions?\n\n-- \nFelipe Contreras\n"},{"id":"240288","messageId":"5360ca37ef906_47db12fd31035@nysa.notmuch","threadId":"35872","inReplyTo":"5360911d8fb6e_597a125b30828@nysa.notmuch","subject":"RE: [PATCH] git-completion.zsh: do not clobber complete()","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T10:02:31Z","receivedAt":"2014-04-30T10:02:31Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Felipe Contreras wrote:\n> Mark Lodato wrote:\n> > Previously, git-completion.zsh redefined complete() to make\n> > __git_complete() a no-op. This broke zsh's built-in bash completion\n> > compatibility layer (bashcompinit), which defines its own complete().\n> \n> How exactly? I'm testing this and I don't see any problems. I run\n> 'type -f _complete' and I get bashcompinit's complete, and the internal\n> _complete() function is used only by the _git completion.\n\nAh, it's complete(), not _complete(). I see the problem and I'll propose\na similar patch.\n\n-- \nFelipe Contreras\n"}]}