From ca3a49ceddd5ee16d82b99cd9060bbdeaddf45cd Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 4 May 2023 22:38:40 +0200 Subject: [PATCH] gitf_publish --- etc/profile.d/git.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 -- 2.47.3