Skip to content

Instantly share code, notes, and snippets.

# show git branch in prompt
# got it from https://gist.github.com/790086
parse_git_branch() {
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return
printf "${1:-(%s)}" "${ref#refs/heads/}"
}
parse_svn_revision() {
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //')