From 3eb81086935434d9c04a1df77bc9243539a6a9b4 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 4 May 2023 00:21:29 +0200 Subject: [PATCH] etc/profile.d/git.sh --- etc/profile.d/git.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 -- 2.47.3