From 8617edf7a1cd6cc8bcdc9ec64d9e11faa28221c2 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Tue, 17 Feb 2015 10:58:04 +0000 Subject: an example prompt built using the git-base functions --- prompt.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 prompt.sh (limited to 'prompt.sh') diff --git a/prompt.sh b/prompt.sh new file mode 100755 index 0000000..99ac6b3 --- /dev/null +++ b/prompt.sh @@ -0,0 +1,23 @@ +source ./git-base.sh + +local_ahead="$(commits_ahead_of_remote)" +ahead_arrow="↑" + +if [[ ("$local_ahead" -gt 0) ]]; then + local_ahead=" ${local_ahead}${ahead_arrow}" +else + local_ahead="" +fi + +local_behind="$(commits_behind_of_remote)" +behind_arrow="↓" + +if [[ "$local_behind" -gt "0" ]]; then + local_behind=" ${local_behind}${behind_arrow}" +else + local_behind="" +fi + +prompt="$(branch_name)$local_ahead$local_behind" + +echo $prompt -- cgit v1.2.3