Summary: prepare-commit-msg skip merges, -m flag, squash, template

Detail: prepare-commit-msg now is skipped if -m flag is supplied, if user has
a template defined, if commit is a squash or a merge.

BUG-ID : none
Reviewed-by: Marcus Sorensen <marcus@betterservers.com>
Reported-by: Marcus Sorensen <marcus@betterservers.com>
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1350600822 -0600
This commit is contained in:
Marcus Sorensen 2012-10-18 16:53:42 -06:00
parent e61aa3aa74
commit a3c9a2b22d

View File

@ -35,7 +35,9 @@
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
cat <<EOF > $1
run_generic_commit () {
local file=$1
cat <<EOF > $file
################################# 80 chars #####################################
# The following is an example of how to fill out the above form. Please limit
# your formatting to 80 cols.
@ -60,5 +62,25 @@ Detail: \n\n\
BUG-ID : \n\
Reviewed-by: \n\
Reported-by: \n\
Signed-off-by: ${SOB}\n\n/" $1
Signed-off-by: ${SOB}\n\n/" $file
}
case "$2,$3" in
merge,*)
;;
template,*)
;;
message,*)
;;
squash,*)
;;
*)
run_generic_commit $1
;;
esac