From a3c9a2b22d53a4c16d0c5b161b62e7ecdffac61b Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Thu, 18 Oct 2012 16:53:42 -0600 Subject: [PATCH] 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 Reported-by: Marcus Sorensen Signed-off-by: Marcus Sorensen 1350600822 -0600 --- tools/git/prepare-commit-msg | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tools/git/prepare-commit-msg b/tools/git/prepare-commit-msg index b51b3777b5e..57c61497bd7 100755 --- a/tools/git/prepare-commit-msg +++ b/tools/git/prepare-commit-msg @@ -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 < $1 +run_generic_commit () { +local file=$1 +cat < $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