Browse files

updated prompt to show last git commit

  • Loading branch information...
1 parent f89159c commit 601e6fbaed891dad631d3174459de032a5982f4a @cosmin committed Oct 7, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 bash/env.sh
View
10 bash/env.sh
@@ -1,4 +1,12 @@
-export PS1="\[\033[01;34m\][\$(date +%H:%M)]\[\033[01;31m\]\$(__git_ps1) \[\033[01;32m\]\h:\[\033[01;34m\]\w$\[\033[0m\] "
+function git_ps1() {
+ local branch=$(__git_ps1 2>/dev/null)
+ if [ -n "$branch" ]; then
+ local ago=$(git log --pretty=format:'%ar' -1)
+ echo "$branch $ago"
+ fi
+}
+
+export PS1="\[\033[01;34m\][\$(date +%H:%M)]\[\033[01;31m\]\$(git_ps1) \[\033[01;32m\]\h:\[\033[01;34m\]\w$\[\033[0m\] "
export EDITOR="emacs -nw"
export PATH="~/bin:/usr/local/bin:/usr/local/sbin:$PATH"
export PYTHONPATH="."

0 comments on commit 601e6fb

Please sign in to comment.