From c85617dd1940bc5fcfa527829841bf90f8ab603e Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 4 May 2023 22:34:19 +0200 Subject: [PATCH] etc/profile.d/git.sh --- etc/profile.d/git.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index f8f8c8db..e1b6a52b 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -70,13 +70,14 @@ EOF # Commit # declare comment - declare default="${file##$(git_root)/}" if [ -n "$(git status --porcelain "$file")" ] then + echo -e ">> COMMIT\n" + declare default="${file##$(git_root)/}" read -e -p "Your comment: " -i "$default" comment if [ -z "$comment" ] then - echo "Commit canceled because of empty comment!" + echo "> Commit canceled because of empty comment!" return 1 fi git commit -m "$comment" "$file" @@ -86,6 +87,7 @@ EOF # # Push # + echo -e ">> PUSH\n" git push # @@ -94,11 +96,17 @@ EOF if [ $(git branch | wc -l) -gt 1 ] then case "$(git_branch)" in - master) git branch | grep ' testing$' && git_merge_to testing;; - testing) git_merge_to master;; + master) + echo -e ">> MERGE TO testing\n" + git branch | grep ' testing$' && git_merge_to testing + ;; + testing) + echo -e ">> MERGE TO master\n" + git_merge_to master + ;; esac else - echo "Only one branch no merging" + echo "> Only one branch no merging" fi } -- 2.47.3