summaryrefslogtreecommitdiffstats
path: root/dotfiles/bashrc
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-07-15 11:14:28 -0400
committerColin Walters <walters@verbum.org>2010-07-15 11:14:28 -0400
commit4f312e890df956a858e1e7278cf1782b8f379d2c (patch)
tree4e5d343b941a0bc0f0b8c6450048eafa20d36ac1 /dotfiles/bashrc
parent4b62292e9573e3b5ede78e09e1fcb886f9e24419 (diff)
downloadhomegit-MOVED-TO-GNOME-4f312e890df956a858e1e7278cf1782b8f379d2c.tar.gz
homegit-MOVED-TO-GNOME-4f312e890df956a858e1e7278cf1782b8f379d2c.tar.xz
homegit-MOVED-TO-GNOME-4f312e890df956a858e1e7278cf1782b8f379d2c.zip
Check for availability of git completion
Diffstat (limited to 'dotfiles/bashrc')
-rw-r--r--dotfiles/bashrc7
1 files changed, 6 insertions, 1 deletions
diff --git a/dotfiles/bashrc b/dotfiles/bashrc
index d49c012..09add68 100644
--- a/dotfiles/bashrc
+++ b/dotfiles/bashrc
@@ -30,6 +30,11 @@ _format_uid ()
fi
}
-PS1='\W$(_format_uid)$(_format_inroot_dir)$(__git_ps1 " [git %s]") \$ '
+PS1_PREFIX='\W$(_format_uid)$(_format_inroot_dir)'
+if test -n "$BASH_COMPLETION" && test -f /etc/bash_completion.d/git; then
+ PS1_PREFIX="$PS1_PREFIX"'$(__git_ps1 " [git %s]")'
+fi
+
+PS1="$PS1_PREFIX"' \$ '
export PS1