]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/git.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 3 May 2023 22:21:29 +0000 (00:21 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 3 May 2023 22:21:29 +0000 (00:21 +0200)
etc/profile.d/git.sh

index 50a2230e35e4f0b1ec74ef059bc0d6c6e69c46e7..ece725d5b16b9fdca6e739f221825c9b36caa770 100644 (file)
@@ -52,19 +52,31 @@ EOF
                ;;
        esac
 
+       declare file="${1:?Args 1: file is missing}"
+       #exec echo $file
        if [ "$1" != "_gitf" ]
        then
-               gitf "$1" gitf_publish _gitf
+               gitf "$file" gitf_publish _gitf "$(realpath "$file")"
                return
        fi
+       shift
 
        #
        # Commit
        #
+       declare comment
+       if [ -n "$(git status --porcelain "$file")" ]
+       then
+               read -p "Your comment (default: $file): " comment
+               [ -z "$comment" ] && comment="$file"
+               echo git commit -m "$comment" "$file"
+       fi
+
 
        #
        # Push
        #
+       echo git push
 
        #
        # Merging