summaryrefslogtreecommitdiff
path: root/bin/giteval
diff options
context:
space:
mode:
authorDavid Wührer <def@gmx.at>2024-05-18 21:04:34 +0200
committerDavid Wührer <def@gmx.at>2024-05-18 21:04:34 +0200
commit77cfffee6177fb0421fa0fce15d6a1875bde4816 (patch)
tree251428cdd482ea50cfb019dbd3c3bafd79d2fd14 /bin/giteval
parent75b23ce1ff0daab363725a2a5755ea80bbeaa68e (diff)
manuals, sum-down, radix
Diffstat (limited to 'bin/giteval')
-rwxr-xr-xbin/giteval15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/giteval b/bin/giteval
new file mode 100755
index 0000000..48d35a8
--- /dev/null
+++ b/bin/giteval
@@ -0,0 +1,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