git-tools: detect options not needing commit message edition
This commit is contained in:
parent
0ff415597e
commit
d737929b9e
|
@ -111,6 +111,18 @@ def -shell-params \
|
||||||
}
|
}
|
||||||
|
|
||||||
commit() {
|
commit() {
|
||||||
|
# Handle case where message needs not to be edited
|
||||||
|
if grep -E -q -e "-m|-F|-C|--message=.*|--file=.*|--reuse-message=.*|--no-edit"; then
|
||||||
|
if git commit "$@" > /dev/null 2>&1; then
|
||||||
|
echo 'echo -color Information Commit succeeded'
|
||||||
|
else
|
||||||
|
echo 'echo -color Error Commit failed'
|
||||||
|
fi
|
||||||
|
exit
|
||||||
|
fi <<-EOF
|
||||||
|
$@
|
||||||
|
EOF
|
||||||
|
|
||||||
# fails, and generate COMMIT_EDITMSG
|
# fails, and generate COMMIT_EDITMSG
|
||||||
GIT_EDITOR='' EDITOR='' git commit > /dev/null 2>&1
|
GIT_EDITOR='' EDITOR='' git commit > /dev/null 2>&1
|
||||||
msgfile="$(git rev-parse --git-dir)/COMMIT_EDITMSG"
|
msgfile="$(git rev-parse --git-dir)/COMMIT_EDITMSG"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user