From: Nicolas Boisselier Date: Thu, 4 May 2023 20:31:00 +0000 (+0200) Subject: gitf_publish X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=008e50d310e5a6555c6b13ec3fdfcf72eaf6c0e2;p=nb.git gitf_publish --- diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index db6de9d6..f8f8c8db 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -36,7 +36,7 @@ EOF declare pwd="$(pwd)" declare cmd="cd \"$(dirname "$file")\" && cd \"\$(git_root)\" && $*" - cmd="$cmd && echo && echo user=\$(whoami) root=\$(pwd)" + cmd="$cmd && echo && echo user=\$(whoami) path=\$(pwd)" if [ "$owner" != "$(id -un)" ]; then su - "$owner" -c "$cmd" else @@ -73,8 +73,12 @@ EOF declare default="${file##$(git_root)/}" if [ -n "$(git status --porcelain "$file")" ] then - read -p "Your comment (default: $default): " comment - [ -z "$comment" ] && comment="$default" + read -e -p "Your comment: " -i "$default" comment + if [ -z "$comment" ] + then + echo "Commit canceled because of empty comment!" + return 1 + fi git commit -m "$comment" "$file" fi