{"thread":{"id":"30253","subject":"[PATCH] completion: fix issues with COMP_WORDBREAKS","startedAt":"2012-04-15T21:17:34Z","lastAt":"2012-04-16T10:44:58Z","messageCount":3,"participants":["Felipe Contreras","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"189359","messageId":"1334524654-13482-1-git-send-email-felipe.contreras@gmail.com","threadId":"30253","inReplyTo":null,"subject":"[PATCH] completion: fix issues with COMP_WORDBREAKS","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-04-15T21:17:34Z","receivedAt":"2012-04-15T21:17:34Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The situation regarding COMP_WORDBREAKS has changed through time, but\nright now due to changes in bash 4 we are using _get_comp_words_by_ref\nand there's no need to mess directly with COMP_WORDBREAKS any more.\n\nIn fact if COMP_WORDBREAKS doesn't contain a colon the completion gets\nall messed up. For example:\n\n git push origin master:<TAB>\n git diff master:<TAB>\n\nThe \"master:\" prefix would be added again, unnecessarily.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash |   14 --------------\n 1 file changed, 14 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9f56ec7..d9771f2 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -65,11 +65,6 @@ if [[ -n ${ZSH_VERSION-} ]]; then\n \tautoload -U +X bashcompinit && bashcompinit\n fi\n \n-case \"$COMP_WORDBREAKS\" in\n-*:*) : great ;;\n-*)   COMP_WORDBREAKS=\"$COMP_WORDBREAKS:\"\n-esac\n-\n # __gitdir accepts 0 or 1 arguments (i.e., location)\n # returns location of .git repo\n __gitdir ()\n@@ -671,11 +666,6 @@ __git_complete_revlist_file ()\n \t\t\t;;\n \t\tesac\n \n-\t\tcase \"$COMP_WORDBREAKS\" in\n-\t\t*:*) : great ;;\n-\t\t*)   pfx=\"$ref:$pfx\" ;;\n-\t\tesac\n-\n \t\tlocal IFS=$'\\n'\n \t\tCOMPREPLY=($(compgen -P \"$pfx\" \\\n \t\t\t-W \"$(git --git-dir=\"$(__gitdir)\" ls-tree \"$ls\" \\\n@@ -758,10 +748,6 @@ __git_complete_remote_or_refspec ()\n \t[ \"$remote\" = \".\" ] && remote=\n \tcase \"$cur_\" in\n \t*:*)\n-\t\tcase \"$COMP_WORDBREAKS\" in\n-\t\t*:*) : great ;;\n-\t\t*)   pfx=\"${cur_%%:*}:\" ;;\n-\t\tesac\n \t\tcur_=\"${cur_#*:}\"\n \t\tlhs=0\n \t\t;;\n-- \n1.7.10\n"},{"id":"189365","messageId":"20120416003850.GH5813@burratino","threadId":"30253","inReplyTo":"1334524654-13482-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] completion: fix issues with COMP_WORDBREAKS","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-04-16T00:38:50Z","receivedAt":"2012-04-16T00:38:50Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Felipe Contreras wrote:\n\n> In fact if COMP_WORDBREAKS doesn't contain a colon the completion gets\n> all messed up. For example:\n>\n>  git push origin master:<TAB>\n>  git diff master:<TAB>\n>\n> The \"master:\" prefix would be added again, unnecessarily.\n\nThanks.  Yeah, that sounds broken.\n\nUnfortunately the patch introduces a regression: if after loading the\ncompletion script I set COMP_WORDBREAKS not to contain a colon, then\nwith the current completion script\n\n\tgit show HEAD:Docu<TAB>\n\ncompletes fine, but with the patched completion script it seems to\nget confused and strips off the HEAD.\n\nIdeas?\nJonathan\n"},{"id":"189380","messageId":"CAMP44s3cM5nZnN6W6KCw-aVdT_-Ax1YTopHkR6b0msSsHhQDmA@mail.gmail.com","threadId":"30253","inReplyTo":"20120416003850.GH5813@burratino","subject":"Re: [PATCH] completion: fix issues with COMP_WORDBREAKS","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-04-16T10:44:58Z","receivedAt":"2012-04-16T10:44:58Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Apr 16, 2012 at 3:38 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Felipe Contreras wrote:\n>\n>> In fact if COMP_WORDBREAKS doesn't contain a colon the completion gets\n>> all messed up. For example:\n>>\n>>  git push origin master:<TAB>\n>>  git diff master:<TAB>\n>>\n>> The \"master:\" prefix would be added again, unnecessarily.\n>\n> Thanks.  Yeah, that sounds broken.\n>\n> Unfortunately the patch introduces a regression: if after loading the\n> completion script I set COMP_WORDBREAKS not to contain a colon, then\n> with the current completion script\n>\n>        git show HEAD:Docu<TAB>\n>\n> completes fine, but with the patched completion script it seems to\n> get confused and strips off the HEAD.\n\nI don't understand, I tested this and it was working fine, but not any more =/\n\nMaybe I was testing on zsh.\n\nI guess this should be dropped then.\n\nCheers.\n\n-- \nFelipe Contreras\n"}]}