[Bug 1088960] Re: Missing __git_ps1

Anders Kaseorg andersk at mit.edu
Tue Dec 11 21:47:13 UTC 2012


No Ubuntu package has ever shipped files in /usr/local.  Either you
installed your own copy of Git manually in /usr/local, in which case you
get to keep both pieces, or you were actually getting __git_ps1 from
somewhere else.  In Ubuntu, you get __git_ps1 via these lines in the
default ~/.bashrc:

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

(which eventually cause /etc/bash_completion.d/git to be sourced).  Are
those lines, or something similar, still present in your ~/.bashrc?

Please also check what version of git is installed (dpkg-query -W git).

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to git in Ubuntu.
https://bugs.launchpad.net/bugs/1088960

Title:
  Missing __git_ps1

Status in “git” package in Ubuntu:
  New

Bug description:
  I have been using this in my bashrc. It no longer works, as of Ubuntu
  12.10.

  if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
    . /usr/local/git/contrib/completion/git-completion.bash
  fi
  export GIT_PS1_SHOWDIRTYSTATE=true

  export PS1="\[\033[36m\][\!][\t] \[\033[1;33m\]\u\[\033[0m\]@\h:\[\033[36m\][\w]:\[\033[0m\]\$(__git_ps1) 
  ---

  I get "__git_ps1: command not found" after every prompt. (Obviously I
  will remove __git_ps1 for now from the prompt.) Please fix.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/git/+bug/1088960/+subscriptions




More information about the foundations-bugs mailing list