Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-2713 hsm: limit HSM RPC count from client
[fs/lustre-release.git]
/
build
/
test-commit-msg.sh
diff --git
a/build/test-commit-msg.sh
b/build/test-commit-msg.sh
index
04f2f08
..
facd9f3
100755
(executable)
--- a/
build/test-commit-msg.sh
+++ b/
build/test-commit-msg.sh
@@
-15,15
+15,15
@@
trap "rm -f $TEMPFILE COMMIT*" EXIT
test $# -eq 0 && set -- ${progdir}/commit.*
test $# -eq 0 && set -- ${progdir}/commit.*
+export FAIL=""
readonly report_fmt='%-20s %s\n'
readonly report_fmt='%-20s %s\n'
-for f
-do
+for f; do
case "$f" in
case "$f" in
-
( *.orig | *.rej ) continue ;;
+ ( *.orig | *.rej ) continue ;;
esac
esac
+
cp $f $TEMPFILE
cp $f $TEMPFILE
- results=$(exec 2>&1
- ${SHELL:-sh} $progdir/commit-msg $TEMPFILE)
+ results=$(exec 2>&1 ${SHELL:-sh} $progdir/commit-msg $TEMPFILE)
case $'\n'"$results" in
( *$'\nerror:'* ) OK=0 ;;
( * ) OK=1 ;;
case $'\n'"$results" in
( *$'\nerror:'* ) OK=0 ;;
( * ) OK=1 ;;
@@
-32,10
+32,15
@@
do
f=$(basename $f)
case $OK${f#*commit.} in
1ok*) printf "$report_fmt" $f: "PASS (was allowed)" ;;
f=$(basename $f)
case $OK${f#*commit.} in
1ok*) printf "$report_fmt" $f: "PASS (was allowed)" ;;
- 0ok*) printf "$report_fmt" $f: "FAIL (not allowed)"
;;
+ 0ok*) printf "$report_fmt" $f: "FAIL (not allowed)"
; FAIL="$FAIL $f"
;;
0*) printf "$report_fmt" $f: "PASS (found error)" ;;
0*) printf "$report_fmt" $f: "PASS (found error)" ;;
- *) printf "$report_fmt" $f: "FAIL (no error)"
;;
+ *) printf "$report_fmt" $f: "FAIL (no error)"
; FAIL="$FAIL $f"
;;
esac
done
esac
done
-rm -f $TEMPFILE
+if [ -n "$FAIL" ]; then
+ echo -e "\nerror: commit-msg test(s) failed!" 1>&2
+ echo " $FAIL"
+fi
+
+rm -f $TEMPFILE $TEMPFILE.*