local base_prompt="${status_color}${exit_status}${COLOR_NONE} ${COLOR_CYAN}\D{%Y%m%d %H:%M:%S}${COLOR_NONE} ${COLOR_CYAN}${debian_chroot:+($debian_chroot) }${COLOR_NONE}${COLOR_YELLOW}\u@\h${COLOR_NONE}:${COLOR_CYAN}\w"
# Check if completion is available
- if type __git_ps1 &> /dev/null; then
- PS1="${base_prompt}$(__git_ps1 " (%s)")${COLOR_NONE} \\$ "
+ # See https://github.com/njhartwell/pw3nage
+ #if type __git_ps1 &> /dev/null; then
+ if [ -x "/usr/bin/git" ]; then
+ #PS1="${base_prompt}$(__git_ps1 " (%s)")${COLOR_NONE} \\$ "
+ branch="`/usr/bin/git branch 2> /dev/null | grep '^* ' | sed -e 's/\* //' -e 's/ $//'`"
+
+ if [ ! -z "$branch" ]; then
+ branch=" (${branch//[^a-z0-9\/]/-})"
+ fi
+
+ PS1="${base_prompt}$branch${COLOR_NONE} \\$ "
else
PS1="${base_prompt}${COLOR_NONE} \\$ "
fi