git/list[1] front-page[2] threads[3] people[4] search[5] about
 

bug in bash completion for git-branch --set-upstream-to on OSX

From
Jason Karns <karns.17@gmail.com>
Date
Mar 20, 2015, 15:15 UTC
Message-ID
<CAKNmmv3wu-5s9UB_RFO5Wptdo+a71Lmzn2Zs4kb=MwnFoTctCg@mail.gmail.com>

There appears to be a bug in the bash completion for git-branch when attempting to complete the remote ref argument for --set-upstream-to=

When:
$ git branch --set-upstream-to=origin/mast<TAB>
I would expect it to complete to:
$ git branch --set-upstream-to=origin/master

However, the completion for --set-upstream-to= completes the ref correctly, but completely wipes the --set-upstream option; resulting in:

$ git branch origin/master

I'm running on OS X 10.9.5 with git from homebrew: $ bash --version GNU bash, version 4.3.33(1)-release (x86_64-apple-darwin13.4.0) $ git --version git version 2.3.3

The same behavior does *not* manifest (it works as expected) on CentOS 6.5, bash 4.1.2.1 (GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)). I'm running git 2.0.3 on CentOs but sourcing the shell completion script from latest source: 9ab698f

I also cloned down latest git source on OS X and the bug still manifests when sourcing the completion script at 9ab698f.

~ Jason
Next: Eric Sunshine
Message 1 of 2 in “bug in bash completion for git-branch --set-upstream-to on OSX”
  1. Jason KarnsMar 20, 2015
  2. Eric SunshineMar 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.