]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/git.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 4 May 2023 20:34:19 +0000 (22:34 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 4 May 2023 20:34:19 +0000 (22:34 +0200)
etc/profile.d/git.sh

index f8f8c8db4031042982ef258fb8f8db1a63c8f9e8..e1b6a52b6ba800180568ae791cc87f18d65173dc 100644 (file)
@@ -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
 }