summaryrefslogtreecommitdiff
path: root/bin/giteval
blob: 48d35a85bd8df53008ecddc2594548470eceb3ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

b=$(git branch --show-current 2> /dev/null) && {
	case $(env - git status --no-ahead-behind | tail -n1) in
		'nothing to commit'*)
			printf '\[\e[32m\][%s]\[\e[0m\]' "$b"
	;;	'no changes added to commit'*)
			printf '\[\e[33m\][%s]\[\e[0m\]' "$b"
	;;	'nothing added to commit'*)
			printf '\[\e[36m\][%s]\[\e[0m\]' "$b"
	;;	*)
			printf '\[\e[31m\][%s]\[\e[0m\]' "$b"
	esac
}
echo