Permalink
Browse files

Simplified bash prompt.

  • Loading branch information...
1 parent 96d18e9 commit b75b108c8e532534a91b94b7f650286e73c61d46 @barendt committed with Nov 20, 2012
Showing with 8 additions and 24 deletions.
  1. +8 −24 .bash_profile
View
@@ -20,35 +20,19 @@ else
export EDITOR="emacs"
fi
-# Got the next bit from https://github.com/garybernhardt/dotfiles/blob/master/.bashrc
-function minutes_since_last_commit {
- now=`date +%s`
- last_commit=`git log --pretty=format:'%at' -1`
- seconds_since_last_commit=$((now-last_commit))
- minutes_since_last_commit=$((seconds_since_last_commit/60))
- echo $minutes_since_last_commit
-}
barendt_git_prompt() {
local g="$(__gitdir)"
if [ -n "$g" ]; then
- local MINUTES_SINCE_LAST_COMMIT=`minutes_since_last_commit`
- if [ "$MINUTES_SINCE_LAST_COMMIT" -gt 30 ]; then
- local COLOR=${RED}
- elif [ "$MINUTES_SINCE_LAST_COMMIT" -gt 10 ]; then
- local COLOR=${YELLOW}
- else
- local COLOR=${GREEN}
- fi
- local SINCE_LAST_COMMIT="$(minutes_since_last_commit)m"
- # The __git_ps1 function inserts the current git branch where %s is
- local GIT_PROMPT=`__git_ps1 "(%s)"`
- echo ${GIT_PROMPT}
- fi
+ # The __git_ps1 function inserts the current git branch where %s is
+ local GIT_PROMPT=`__git_ps1 "(\e[1;34m%s\e[m)"`
+ echo ${GIT_PROMPT}
+ fi
}
+
PS1="\h:\W\$(barendt_git_prompt) \u\$ "
-gd() { git diff $* | view -; }
-gdc() { gd --cached $*; }
-alias pygrep="grep --include='*.py' $*"
+# gd() { git diff $* | view -; }
+# gdc() { gd --cached $*; }
+# alias pygrep="grep --include='*.py' $*"
source ~/bin/git-completion.bash
function wigrep() {

0 comments on commit b75b108

Please sign in to comment.