This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# git-branch-status | |
# * originally by http://github.com/jehiah | |
# * "s'all good!" message by http://github.com/kd35a | |
# * ANSI colors by http://github.com/knovoselic | |
# * column formatting, filters, and usage by http://github.com/bill-auger | |
# this script prints out pretty git branch sync status reports |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEFAULT="\[\033[1;00m\]" | |
BLACK="\[\033[1;30m\]" | |
YELLOW="\[\033[1;33m\]" | |
GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
BLUE="\[\033[1;36m\]" | |
# Returns "*" if the current git branch is dirty. | |
function parse_git_dirty { | |
[[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo "*" | |
} |