{"thread":{"id":"36552","subject":"[PATCH 0/6] completion: fixes","startedAt":"2014-04-30T11:07:39Z","lastAt":"2014-04-30T11:07:45Z","messageCount":7,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"240289","messageId":"1398856065-2982-1-git-send-email-felipe.contreras@gmail.com","threadId":"36552","inReplyTo":null,"subject":"[PATCH 0/6] completion: fixes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T11:07:39Z","receivedAt":"2014-04-30T11:07:39Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"A bunch of cleanups and fixes.\n\n\nFelipe Contreras (6):\n  completion: bash: remove old wrappers\n  completion: bash: remove zsh wrapper\n  completion: zsh: don't hide ourselves\n  completion: remove zsh hack\n  completion: zsh: trivial cleanups\n  completion: bash: cleanup cygwin check\n\n contrib/completion/git-completion.bash | 80 +---------------------------------\n contrib/completion/git-completion.zsh  | 18 ++------\n 2 files changed, 6 insertions(+), 92 deletions(-)\n\n-- \n1.9.2+fc1.11.g71fb719\n"},{"id":"240291","messageId":"1398856065-2982-2-git-send-email-felipe.contreras@gmail.com","threadId":"36552","inReplyTo":"1398856065-2982-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 1/6] completion: bash: remove old wrappers","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T11:07:40Z","receivedAt":"2014-04-30T11:07:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash | 12 ------------\n 1 file changed, 12 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9525343..6e331d2 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2656,18 +2656,6 @@ __git_complete ()\n \t\t|| complete -o default -o nospace -F $wrapper $1\n }\n \n-# wrapper for backwards compatibility\n-_git ()\n-{\n-\t__git_wrap__git_main\n-}\n-\n-# wrapper for backwards compatibility\n-_gitk ()\n-{\n-\t__git_wrap__gitk_main\n-}\n-\n __git_complete git __git_main\n __git_complete gitk __gitk_main\n \n-- \n1.9.2+fc1.11.g71fb719\n"},{"id":"240290","messageId":"1398856065-2982-3-git-send-email-felipe.contreras@gmail.com","threadId":"36552","inReplyTo":"1398856065-2982-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 2/6] completion: bash: remove zsh wrapper","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T11:07:41Z","receivedAt":"2014-04-30T11:07:41Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It has been deprecated for one year and a half. It's time to move on.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash | 64 ----------------------------------\n 1 file changed, 64 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 6e331d2..be0ea36 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2574,70 +2574,6 @@ __gitk_main ()\n \t__git_complete_revlist\n }\n \n-if [[ -n ${ZSH_VERSION-} ]]; then\n-\techo \"WARNING: this script is deprecated, please see git-completion.zsh\" 1>&2\n-\n-\tautoload -U +X compinit && compinit\n-\n-\t__gitcomp ()\n-\t{\n-\t\temulate -L zsh\n-\n-\t\tlocal cur_=\"${3-$cur}\"\n-\n-\t\tcase \"$cur_\" in\n-\t\t--*=)\n-\t\t\t;;\n-\t\t*)\n-\t\t\tlocal c IFS=$' \\t\\n'\n-\t\t\tlocal -a array\n-\t\t\tfor c in ${=1}; do\n-\t\t\t\tc=\"$c${4-}\"\n-\t\t\t\tcase $c in\n-\t\t\t\t--*=*|*.) ;;\n-\t\t\t\t*) c=\"$c \" ;;\n-\t\t\t\tesac\n-\t\t\t\tarray[${#array[@]}+1]=\"$c\"\n-\t\t\tdone\n-\t\t\tcompset -P '*[=:]'\n-\t\t\tcompadd -Q -S '' -p \"${2-}\" -a -- array && _ret=0\n-\t\t\t;;\n-\t\tesac\n-\t}\n-\n-\t__gitcomp_nl ()\n-\t{\n-\t\temulate -L zsh\n-\n-\t\tlocal IFS=$'\\n'\n-\t\tcompset -P '*[=:]'\n-\t\tcompadd -Q -S \"${4- }\" -p \"${2-}\" -- ${=1} && _ret=0\n-\t}\n-\n-\t__gitcomp_file ()\n-\t{\n-\t\temulate -L zsh\n-\n-\t\tlocal IFS=$'\\n'\n-\t\tcompset -P '*[=:]'\n-\t\tcompadd -Q -p \"${2-}\" -f -- ${=1} && _ret=0\n-\t}\n-\n-\t_git ()\n-\t{\n-\t\tlocal _ret=1 cur cword prev\n-\t\tcur=${words[CURRENT]}\n-\t\tprev=${words[CURRENT-1]}\n-\t\tlet cword=CURRENT-1\n-\t\temulate ksh -c __${service}_main\n-\t\tlet _ret && _default && _ret=0\n-\t\treturn _ret\n-\t}\n-\n-\tcompdef _git git gitk\n-\treturn\n-fi\n-\n __git_func_wrap ()\n {\n \tlocal cur words cword prev\n-- \n1.9.2+fc1.11.g71fb719\n"},{"id":"240293","messageId":"1398856065-2982-4-git-send-email-felipe.contreras@gmail.com","threadId":"36552","inReplyTo":"1398856065-2982-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 3/6] completion: zsh: don't hide ourselves","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T11:07:42Z","receivedAt":"2014-04-30T11:07:42Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There's no need to hide the fact that we are on zsh any more.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\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 6b77968..6432b3f 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+. \"$script\"\n \n __gitcomp ()\n {\n-- \n1.9.2+fc1.11.g71fb719\n"},{"id":"240292","messageId":"1398856065-2982-5-git-send-email-felipe.contreras@gmail.com","threadId":"36552","inReplyTo":"1398856065-2982-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 4/6] completion: remove zsh hack","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T11:07:43Z","receivedAt":"2014-04-30T11:07:43Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We don't want to override the 'complete()' function in zsh, which can be\nused by bashcomp.\n\nReported-by: Mark Lodato <lodato@google.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash | 1 +\n contrib/completion/git-completion.zsh  | 6 ------\n 2 files changed, 1 insertion(+), 6 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex be0ea36..f1ce962 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2586,6 +2586,7 @@ __git_func_wrap ()\n # This is NOT a public function; use at your own risk.\n __git_complete ()\n {\n+\ttest -n \"$ZSH_VERSION\" && 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 6432b3f..e71896a 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-- \n1.9.2+fc1.11.g71fb719\n"},{"id":"240294","messageId":"1398856065-2982-6-git-send-email-felipe.contreras@gmail.com","threadId":"36552","inReplyTo":"1398856065-2982-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 5/6] completion: zsh: trivial cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T11:07:44Z","receivedAt":"2014-04-30T11:07:44Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We don't need to override IFS, zsh has a native way of splitting by new\nlines: the expansion flag (f).\n\nAlso, we don't need to split files by ':' or '='; that's only for words.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.zsh | 10 +++-------\n 1 file changed, 3 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh\nindex e71896a..f72f71c 100644\n--- a/contrib/completion/git-completion.zsh\n+++ b/contrib/completion/git-completion.zsh\n@@ -65,26 +65,22 @@ __gitcomp_nl ()\n {\n \temulate -L zsh\n \n-\tlocal IFS=$'\\n'\n \tcompset -P '*[=:]'\n-\tcompadd -Q -S \"${4- }\" -p \"${2-}\" -- ${=1} && _ret=0\n+\tcompadd -Q -S \"${4- }\" -p \"${2-}\" -- ${(f)1} && _ret=0\n }\n \n __gitcomp_nl_append ()\n {\n \temulate -L zsh\n \n-\tlocal IFS=$'\\n'\n-\tcompadd -Q -S \"${4- }\" -p \"${2-}\" -- ${=1} && _ret=0\n+\tcompadd -Q -S \"${4- }\" -p \"${2-}\" -- ${(f)1} && _ret=0\n }\n \n __gitcomp_file ()\n {\n \temulate -L zsh\n \n-\tlocal IFS=$'\\n'\n-\tcompset -P '*[=:]'\n-\tcompadd -Q -p \"${2-}\" -f -- ${=1} && _ret=0\n+\tcompadd -Q -p \"${2-}\" -f -- ${(f)1} && _ret=0\n }\n \n __git_zsh_bash_func ()\n-- \n1.9.2+fc1.11.g71fb719\n"},{"id":"240295","messageId":"1398856065-2982-7-git-send-email-felipe.contreras@gmail.com","threadId":"36552","inReplyTo":"1398856065-2982-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 6/6] completion: bash: cleanup cygwin check","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-04-30T11:07:45Z","receivedAt":"2014-04-30T11:07:45Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Avoid Yoda conditions, use test, and cleaner statement.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex f1ce962..34edef9 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2600,6 +2600,5 @@ __git_complete gitk __gitk_main\n # when the user has tab-completed the executable name and consequently\n # included the '.exe' suffix.\n #\n-if [ Cygwin = \"$(uname -o 2>/dev/null)\" ]; then\n+test \"$(uname -o 2>/dev/null)\" = \"Cygwin\" &&\n __git_complete git.exe __git_main\n-fi\n-- \n1.9.2+fc1.11.g71fb719\n"}]}