From: Nicolas Boisselier Date: Wed, 3 May 2023 22:21:29 +0000 (+0200) Subject: etc/profile.d/git.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=3eb81086935434d9c04a1df77bc9243539a6a9b4;p=nb.git etc/profile.d/git.sh --- diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index 50a2230e..ece725d5 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -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