Skip to content

Commit 198afd0

Browse files
Signed-off-by checker in precommit testing script.
Related issue: #15 (#15). JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
1 parent 51ddb25 commit 198afd0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tools/precommit.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ shift
2323
TARGETS="$1"
2424
shift
2525

26+
# Checking presence and correctness of Signed-off-by message
27+
commit_hash=`git show -s --format=%H HEAD`
28+
author_name=`git show -s --format=%an HEAD`
29+
author_email=`git show -s --format=%ae HEAD`
30+
required_signed_off_by_line="JerryScript-DCO-1.0-Signed-off-by: $author_name $author_email"
31+
actual_signed_off_by_line=`git show -s --format=%B HEAD | sed '/^$/d' | tail -n 1`
32+
33+
if [ "$actual_signed_off_by_line" != "$required_signed_off_by_line" ]
34+
then
35+
echo -e "\e[1;33m Signed-off-by message is incorrect. The following line should be at the end of the $commit_hash commit's message: '$required_signed_off_by_line'. \e[0m\n"
36+
37+
exit 1
38+
fi
39+
2640
VERA_DIRECTORIES_EXCLUDE_LIST="-path ./third-party -o -path tests"
2741
VERA_CONFIGURATION_PATH="./tools/vera++"
2842

0 commit comments

Comments
 (0)