You are not logged in.
Pages: 1
Topic closed
Hi!
Since the update of bash-completion (1.99-1) it doesn't work anymore for git (e.g. for completing branch names).
Any hints?
Last edited by Edward E. Edwardson (2012-03-23 10:38:12)
Offline
I fixed it by replacing the following line in /etc/bash.bashrc
[ -r /etc/bash_completion ] && . /etc/bash_completion
with
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
Found it in /etc/bash.bashrc.pacnew.
Offline
It doesn't work for me:
$ . /usr/share/bash-completion/bash_completion
bash: __git_ps1: command not found
$ ls -l /usr/share/bash-completion/completions/git
-rw-r--r-- 1 root root 56081 Mar 27 11:28 /usr/share/bash-completion/completions/git
bash: __git_ps1: command not found
Offline
It doesn't work for me:
It happens the same to me, but it gets solved when I invoke bash_completion on git, I mean:
ichramm@notparallel:~$
bash: __git_ps1: command not found
ichramm@notparallel:~$ git <tab><tab>
add br ci config filter-branch help lola pull replace show svn
am bra cia credential-cache format-patch imap-send ls push request-pull show-branch tag
annotate branch citool credential-store fsck init merge rebase reset st whatchanged
apply bundle clean describe gc instaweb mergetool reflog revert stage
archive checkout clone diff get-tar-commit-id lg mv relink rm stash
bisect cherry co difftool grep log name-rev remote send-email status
blame cherry-pick commit fetch gui lol notes repack shortlog submodule
ichramm@notparallel:~$ git ^C
ichramm@notparallel:~$ ^C
ichramm@notparallel:~$
ichramm@notparallel:~$
I couldn't figure out yet what the problem is
Offline
You can fix this by running
# ln -s /usr/share/git/completion/git-completion.bash /etc/bash_completion.d/git
as root (and then open a new shell).
Git's bash completion script doesn't just load the completions: it also defines __git_ps1 and a few other things.
git-1.7.9.4-1 installs /etc/bash_completion.d/git (which gets loaded every time you run a shell), but in git-1.7.9.5-1 it instead installs /usr/share/bash-completion/completions/git/ (which apparently gets loaded on-the-fly when you try to complete a git command).
I'm not sure if this is an intentional change or a mistake. I filed a bug at https://bugs.archlinux.org/task/29141, but maybe this is just an additional step people will now need to do if they want to use __git_ps1.
Offline
Why I encountered like this after I update bash-completion to 1.99-2
bash: _compopt_o_filenames: command not found
Offline
I fixed it with zsh, by adding this line into /etc/profile:
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
here:
# Source global bash config
if test "$PS1" && test "$BASH" && test -z ${POSIXLY_CORRECT+x} && test -r /etc/bash.bashrc; then
. /etc/bash.bashrc
fi
[-r /usr/share/bash-completion/bash_completion ] && ./usr/share/bash-completion/bash_completion
Offline
The thread is five years old and marked as solved. Don't necrobump: https://wiki.archlinux.org/index.php/Co … bumping.22
Closing
Offline
Pages: 1
Topic closed