After setting up bash completion support for git (version 2.14.5
on Slackware Linux 14.2) using the file contrib/completion/git-completion.bash from the git master repository as described and already did for other commands, I expected to get git commands as completion words on ususal TAB-completion hits like for git [TAB][TAB]. For instance:
$ git c[TAB][TAB]
checkout commit clone ...
Instead of getting any git commands like checkout, commit, or else, only filenames are suggested or completed. Whereas, when requesting completion with dashes like git --b[TAB][TAB], then git options, like --bare are suggested or completed well.
I know, there are a lot of similar questions out there, but despite searching the answers, I could not find a proper solution to solve this issue.
- The
git-completion.bashfile is sourced correctly; after sourcing with. git-completion.bashits functions are available in the executing bash environment, asdeclare -fshows. - The
progcompshell option ison. - The git completion function is registered as the output of
complete -p gitshows:$ complete -p git complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git - After inspecting the sourced
git-completion.bashfile, I can say, the completion function__git_wrap__git_mainis called ongit [TAB]hits, but theCOMPREPLYvariable is not filled with completion words when requesting completion without double-dashes--*
Has anybody an idea why only git options are completed while git commands are not?