gose·vor 14 Jahren·discussSame here. Here's the script for a git-aware bash prompt if anyone else is interested.function parse_git_dirty { [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" }function parse_git_branch { git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ \1$(parse_git_dirty)/" }PS1='[\w$(parse_git_branch)] '
gose·vor 15 Jahren·discussHere's Mac OS X's:http://www.opensource.apple.com/source/shell_cmds/shell_cmds...It's close to the FreeBSD implementation.
gose·vor 15 Jahren·discussReminds me of this quote from Simon Sinek:"People don't buy what you do, they buy why you do it."He uses Apple quite a bit in his analogy here:http://www.ted.com/talks/simon_sinek_how_great_leaders_inspi...
function parse_git_dirty {
}
function parse_git_branch {
}
PS1='[\w$(parse_git_branch)] '