Description of problem: Somehow (probably during upgrade to F29) bash completion stopped working for completing git commands. Version-Release number of selected component (if applicable): bash-completion-1:2.8-3.fc29.noarch git-core-2.20.1-1.fc29.x86_64 How reproducible: always Steps to Reproduce: 1.type: git chec<TAB> Actual results: Nothing is completed Expected results: It should be completed to: git checkout Additional info: I've tried to reinstall: dnf reinstall git-core dnf reinstall bash-completion haven't helped. Doing . /usr/share/bash-completion/completions/git helps, but only for active bash session.
Can I do anything to help investigate this?
Bump
Honza, could you please run the following command and attach strace.txt ? $ strace -e trace=%file -o strace.txt bash -l
Created attachment 1592613 [details] strace -e trace=%file -o strace.txt bash -l
Please try the following: 1. run `set -x` in your interactive bash session 2. try to autocomplete a git command 3. attach the text printed to your terminal
Created attachment 1592647 [details] git stat<TAB> with set -x Not sure of the relevance, but I noticed in the output: ++++ git help -a ++++ egrep --color=auto '^ [a-zA-Z0-9]' Doing $ git help -a | egrep --color=auto '^ [a-zA-Z0-9]' returns nothing, because the commands have 3 spaces at the beginning of the line: $ git help -a See 'git help <command>' to read about a specific subcommand Main Porcelain Commands add Add file contents to the index am Apply a series of patches from a mailbox [...]
Created attachment 1592672 [details] git stat<TAB> with set -x and sourced git completions I tried it also with doing the source of /usr/share/bash-completion/completions/git file, the output looks quite different.
Please paste output of the following commands executed in a fresh bash session: $ complete | grep git\$ $ complete | grep D\$ $ declare -f _completion_loader
$ complete | grep git\$ complete -o bashdefault -o default -o nospace -F _git git $ complete | grep D\$ complete -F _completion_loader -D $ declare -f _completion_loader _completion_loader () { local cmd="${1:-_EmptycmD_}"; __load_completion "$cmd" && return 124; complete -F _minimal -- "$cmd" && return 124 }
(In reply to Honza Brázdil from comment #9) > $ complete | grep git\$ > complete -o bashdefault -o default -o nospace -F _git git Something in your configuration sets a completion hook for git that does not work. If you get rid of it, _completion_loader() will load the hook provided by git-core, which works fine. You can try to find culprit like this: $ grep -r 'complete.*git' /etc/{bash_completion,profile}.d If there is no match, look at the other sourced files, based on attachment #1592613 [details].
Thanks, it was because of third-party branch_in_prompt.sh script. Weird that it worked before but the script was not updated in a long time so it's probably outdated by now. Removing that script fixed it.
Glad to see it resolved. Thank you for clarifying it!