{"thread":{"id":"47514","subject":"possible completion bug with --set-upstream-to=","startedAt":"2017-12-30T00:26:25Z","lastAt":"2017-12-30T14:51:52Z","messageCount":3,"participants":["Ernesto Alfonso","SZEDER Gábor","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"335553","messageId":"87bmih83iu.fsf@gmail.com","threadId":"47514","inReplyTo":null,"subject":"possible completion bug with --set-upstream-to=","fromName":"Ernesto Alfonso","fromEmail":"erjoalgo@gmail.com","sentAt":"2017-12-30T00:26:17Z","receivedAt":"2017-12-30T00:26:25Z","isPatch":false,"sender":{"key":"erjoalgo@gmail.com","avatar":null},"body":"\n\nWhenever I type the last <TAB> to complete origin/master, as in below:\n\n> git branch --set-upstream-to=orig<TAB>\n\nwhat I get is:\n\n> git branch origin/master\n\ninstead of the expected:\n\n> git branch --set-upstream-to=origin/master\n\ngit version and OS:\n\n>git version 2.1.4\n>\n>Distributor ID:\tDebian\n>Description:\tDebian GNU/Linux 8.7 (jessie)\n>Release:\t8.7\n>Codename:\tjessie\n>\n\nThanks,\n\nErnesto\n"},{"id":"335556","messageId":"20171230082806.6303-1-szeder.dev@gmail.com","threadId":"47514","inReplyTo":"87bmih83iu.fsf@gmail.com","subject":"Re: possible completion bug with --set-upstream-to=","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2017-12-30T08:28:06Z","receivedAt":"2017-12-30T08:28:23Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"\n> Whenever I type the last <TAB> to complete origin/master, as in below:\n> \n> > git branch --set-upstream-to=orig<TAB>\n> \n> what I get is:\n> \n> > git branch origin/master\n\nYeah, this shouldn't happen. \n\n> instead of the expected:\n> \n> > git branch --set-upstream-to=origin/master\n\nAnd indeed this is the expected behavior.\n\n> git version and OS:\n> \n> >git version 2.1.4\n\nI couldn't reproduce the wrong behavior you saw using v2.1.4 in a\nregular setup.\n \nHowever, I could reproduce it after I removed the '=' character from\nthe set of characters in $COMP_WORDBREAKS, but then all completions\nafter an '--option=' are affected, e.g. 'pulseaudio --daemonize=t<TAB>\nbecomes 'pulseaudio true', too.\n\nCould you tell us the content of your $COMP_WORDBREAKS using the\noutput of the following command (to make the included space, tab and\nnewline visible):\n\n  printf \"$COMP_WORDBREAKS\" |tr ' \\t\\n' STN ; echo\n\nIf it's indeed the case that $COMP_WORDBREAKS is missing the '=', then\nyou should add it back and check whether it fixed the issue.  If it\ndid fix it, then you should try to figure out how the '=' got removed\nfrom there.  Perhaps you used a program that ships its own completion\nscript whose developers changed $COMP_WORDBREAKS to their liking, not\nknowing about its effect on other completion scripts.\n\n\nGábor\n\n"},{"id":"335562","messageId":"20171230145143.GB29252@sigill.intra.peff.net","threadId":"47514","inReplyTo":"20171230082806.6303-1-szeder.dev@gmail.com","subject":"Re: possible completion bug with --set-upstream-to=","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-12-30T14:51:44Z","receivedAt":"2017-12-30T14:51:52Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Dec 30, 2017 at 09:28:06AM +0100, SZEDER Gábor wrote:\n\n> I couldn't reproduce the wrong behavior you saw using v2.1.4 in a\n> regular setup.\n>  \n> However, I could reproduce it after I removed the '=' character from\n> the set of characters in $COMP_WORDBREAKS, but then all completions\n> after an '--option=' are affected, e.g. 'pulseaudio --daemonize=t<TAB>\n> becomes 'pulseaudio true', too.\n\nI can reproduce here on my Debian unstable system.\n\n> Could you tell us the content of your $COMP_WORDBREAKS using the\n> output of the following command (to make the included space, tab and\n> newline visible):\n> \n>   printf \"$COMP_WORDBREAKS\" |tr ' \\t\\n' STN ; echo\n> \n> If it's indeed the case that $COMP_WORDBREAKS is missing the '=', then\n> you should add it back and check whether it fixed the issue.  If it\n> did fix it, then you should try to figure out how the '=' got removed\n> from there.  Perhaps you used a program that ships its own completion\n> script whose developers changed $COMP_WORDBREAKS to their liking, not\n> knowing about its effect on other completion scripts.\n\nLooks like the system npm completion is the culprit:\n\n  $ grep COMP_WORDBREAKS /etc/bash_completion.d/*\n  /etc/bash_completion.d/npm:COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}\n  /etc/bash_completion.d/npm:COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}\n  /etc/bash_completion.d/npm:export COMP_WORDBREAKS\n\n  $ dpkg -S /etc/bash_completion.d/npm\n  npm: /etc/bash_completion.d/npm\n\nLooks like there's already a bug filed:\n\n  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711810\n\nSadly there's even a patch which was taken upstream, but the debian\npackaged version of npm is just woefully out of date.\n\n-Peff\n"}]}