X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fscripts%2Fcheck_commit_msg.sh;h=6869fbf6561064daad5bfca2ab4242722837ab99;hb=4a76d6f6da035220917097bc047b08bc58254803;hp=14722fa4939a8bb91e3ed52f2b4e0e9887221249;hpb=ff34b916a932ed11cc2867baccfd84c407e54c0e;p=vpp.git diff --git a/extras/scripts/check_commit_msg.sh b/extras/scripts/check_commit_msg.sh index 14722fa4939..6869fbf6561 100755 --- a/extras/scripts/check_commit_msg.sh +++ b/extras/scripts/check_commit_msg.sh @@ -1,8 +1,9 @@ #/bin/env bash KNOWN_FEATURES=$(cat MAINTAINERS | sed -ne 's/^I:[[:space:]]*//p') -FEATURES=$(git show -s --format=%s --no-color | sed -e 's/\(.*\):.*/\1/') -KNOWN_TYPES="feature fix refactor style docs test make" +FEATURES=$(git show -s --format=%s --no-color \ + | sed -ne 's/^\([a-z0-9_ -]*\):.*$/\1/p') +KNOWN_TYPES="feature fix refactor improvement style docs test make" TYPE=$(git show -s --format=%b --no-color | sed -ne 's/^Type:[[:space:]]*//p') ERR="=============================== ERROR ===============================" @@ -12,7 +13,7 @@ if [ $(echo ${FEATURES} | wc -w) -eq 0 ]; then echo "git commit 'Subject:' line must contain at least one known feature id." echo "feature id(s) must be listed before ':' and space delimited " echo "if more then one is listed." - echo "Please reffer to MAINTAINERS file (I: lines) for known feature ids." + echo "Please refer to the MAINTAINERS file (I: lines) for known feature ids." echo $ERR exit 1 fi @@ -26,8 +27,8 @@ for i in ${FEATURES}; do if [ ${is_known} = "false" ] ; then echo $ERR echo "Unknown feature '${i}' in commit 'Subject:' line." - echo "Feature must exist in MAINTAINERS file. If this commit intruduces " - echo "new feature, then this commit must add new entry into the " + echo "Feature must exist in MAINTAINERS file. If this commit introduces " + echo "a new feature, then this commit must add an entry to the " echo "MAINTAINERS file." echo $ERR exit 1 @@ -47,4 +48,6 @@ if [ ${is_known} = "false" ] ; then echo $ERR exit 1 fi - +echo "*******************************************************************" +echo "* VPP Commit Message Checkstyle Successfully Completed" +echo "*******************************************************************"