From: Nicolas Boisselier Date: Thu, 4 May 2023 20:38:40 +0000 (+0200) Subject: gitf_publish X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=ca3a49ceddd5ee16d82b99cd9060bbdeaddf45cd;p=nb.git gitf_publish --- diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index e1b6a52b..ef137920 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -66,13 +66,14 @@ EOF shift declare file="${1:?Args 1: file is missing}" + declare fmt='>>\n>> %s\n>>\n' # # Commit # declare comment if [ -n "$(git status --porcelain "$file")" ] then - echo -e ">> COMMIT\n" + printf "$fmt" "COMMIT" declare default="${file##$(git_root)/}" read -e -p "Your comment: " -i "$default" comment if [ -z "$comment" ] @@ -87,7 +88,7 @@ EOF # # Push # - echo -e ">> PUSH\n" + printf "$fmt" "PUSH" git push # @@ -97,11 +98,11 @@ EOF then case "$(git_branch)" in master) - echo -e ">> MERGE TO testing\n" + printf "$fmt" "MERGE TO testing" git branch | grep ' testing$' && git_merge_to testing ;; testing) - echo -e ">> MERGE TO master\n" + printf "$fmt" "MERGE TO master" git_merge_to master ;; esac