From 53ef274cba97dbab523c604eeb1b7c923ca9411f Mon Sep 17 00:00:00 2001 From: Andrew Stowell Date: Tue, 2 Jul 2024 14:31:07 -0400 Subject: [PATCH] status-all script now also displays branch name when not main/dev. --- status-all.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/status-all.sh b/status-all.sh index 6790781..d33e258 100755 --- a/status-all.sh +++ b/status-all.sh @@ -42,10 +42,17 @@ function process_git_status () { cd "$location" output="" info=$(git -c color.status=always status) + branch=$(git branch --show-current) remote=$(git remote -vv) upstream=$(git for-each-ref --format='%(upstream)' $(cat .git/HEAD)) # 33 is yellow text + # show name of branch unless on main or dev (also ignore blank '', for detached head) + if [[ "$branch" != "" ]] && [[ "$branch" != "main" ]] && [[ "$branch" != "dev" ]]; then + # 1;34 is bright blue + output="$output\n *  on branch '$branch' " + fi + # display any tracking issue, 43 is yellow background if [[ "$remote" == "" ]]; then output="$output\n *  no upstream repo "