From 5583124d0b23e26c0dcc23b5343bff6766068052 Mon Sep 17 00:00:00 2001 From: Abhishek Keshri Date: Thu, 1 Dec 2022 18:07:19 +0530 Subject: [PATCH] Shorten long branch names --- scripts/git.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/git.sh b/scripts/git.sh index 9130292..b176144 100755 --- a/scripts/git.sh +++ b/scripts/git.sh @@ -37,10 +37,10 @@ for i in $(git -C $path status -s) done output="" - [ $added -gt 0 ] && output+="${added}  " - [ $modified -gt 0 ] && output+=" ${modified}  " - [ $updated -gt 0 ] && output+=" ${updated}  " - [ $deleted -gt 0 ] && output+=" ${deleted}  " + [ $added -gt 0 ] && output+="${added} " + [ $modified -gt 0 ] && output+=" ${modified} " + [ $updated -gt 0 ] && output+=" ${updated} " + [ $deleted -gt 0 ] && output+=" ${deleted} " echo $output } @@ -102,7 +102,7 @@ checkForGitDir() getBranch() { if [ $(checkForGitDir) == "true" ]; then - echo $(git -C $path rev-parse --abbrev-ref HEAD)  + printf "%.20s " $(git -C $path rev-parse --abbrev-ref HEAD) else echo $no_repo_message fi