From 89e56742e8b95530270d6b043d0477b7e6932614 Mon Sep 17 00:00:00 2001 From: Pontus Pihlgren Date: Wed, 27 Sep 2023 10:57:35 +0200 Subject: [PATCH] Switch order of unpulled and unpushed indicator, update help text --- git-summary | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/git-summary b/git-summary index 88f758b..1972661 100755 --- a/git-summary +++ b/git-summary @@ -31,16 +31,15 @@ usage() { - the repo path - the currently checked out branch - - a short 2-column status string showing whether there are: + - a short 5-column status string showing whether there are: * Local Changes: - - untracked files "?_" - - uncommitted new files "+_" - - uncommitted changes "M_" - - (nothing) " _" + - untracked files "? " + - uncommitted new files " + " + - uncommitted changes " M " + - unpushed commits for the current branch " ^ " + - no remote or no upstream branch " --" * Remote Changes: - - unpulled commits for the current branch "_v" - - unpushed commits for the current branch "_^" - - (nothing) "_ " + - unpulled commits for the current branch " v" Arguments: @@ -259,20 +258,19 @@ summarize_one_git_repo () { local unpulled=`gitC $f log --pretty=format:'%h' ..@{u} | wc -c` local unpushed=`gitC $f log --pretty=format:'%h' @{u}.. | wc -c` - if [ $unpulled -ne 0 ]; then - rstate="${rstate}v" + if [ $unpushed -ne 0 ]; then + rstate="${rstate}^" numState=1 else rstate="${rstate} " fi - if [ $unpushed -ne 0 ]; then - rstate="${rstate}^" + if [ $unpulled -ne 0 ]; then + rstate="${rstate}v" numState=1 else rstate="${rstate} " fi - else rstate="--" fi