+function is_coverity_fix()
+{
+ # subject starts with Fix coverity defects means it's a coverity fix
+ subject=$(git log -n 1 --pretty=%s "$REF" | egrep -m 1 '^Fix coverity defects')
+ if [ -n "$subject" ]; then
+ return 0
+ fi
+
+ return 1
+}
+
+function coverity_fix_commit()
+{
+ error=0
+
+ # subject starts with Fix coverity defects: CID dddd, dddd...
+ subject=$(git log -n 1 --pretty=%s "$REF" |
+ egrep -m 1 'Fix coverity defects: CID [[:digit:]]+(, [[:digit:]]+)*')
+ if [ -z "$subject" ]; then
+ echo "error: Coverity defect fixes must have a subject line that starts with \"Fix coverity defects: CID dddd\""
+ error=1
+ fi
+
+ # need a signed off by
+ if ! check_tagged_line "Signed-off-by" ; then
+ error=1
+ fi
+
+ # test each summary line for the proper format
+ OLDIFS=$IFS
+ IFS=$'\n'
+ for line in $(git log -n 1 --pretty=%b "$REF" | egrep '^CID'); do
+ echo "$line" | egrep '^CID [[:digit:]]+: ([[:graph:]]+|[[:space:]])+ \(([[:upper:]]|\_)+\)' > /dev/null
+ if [[ $? -ne 0 ]]; then
+ echo "error: commit message has an improperly formatted CID defect line"
+ error=1
+ fi
+ done
+ IFS=$OLDIFS
+
+ # ensure that no lines in the body of the commit are over 72 characters
+ if ! test_commit_bodylength; then
+ error=1
+ fi
+
+ return $error
+}
+