dot

packages and services management
Log | Files | Refs | README

commit 4da46f6f89131a5fcbaf5ae760ef7a8e8c392b92
parent 3e8acbafa6df5b049768617c22aed233d901f4cd
Author: josuah <mail@josuah.net>
Date:   Sat, 17 Dec 2016 12:53:55 +0000

Even simpler git prompt

Diffstat:
M.local/bin/git-prompt | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/.local/bin/git-prompt b/.local/bin/git-prompt @@ -1,8 +1,4 @@ -cd "$1" - -git rev-parse 2> /dev/null || exit 0 - -git status --porcelain -b | awk ' +git rev-parse 2> /dev/null && git status --porcelain -b | awk ' /^## / { branch = $0; sub(/^## /, "", branch); @@ -36,8 +32,7 @@ m == 1 { m = 0; } END { printf(" \033[1m%s\033[0m", branch); - if (untracked + conflicts + changed + staged + behind + ahead \ - == 0) { + if (untracked + conflicts + changed + staged + behind + ahead == 0) { printf " \033[32mok\033[0m"; } else { if (untracked) printf " \033[33m?\033[0m%d", untracked; @@ -48,4 +43,3 @@ END { if (ahead ) printf " \033[36m↑\033[0m%d", ahead ; } }' -