commit-msg: Match the Signed-off-by line with name and mail address

The previous regular expression only matches the line starting with
"Signed-off-by:". If the name and mail address are missing, it can not
find out. The following words should be "name <mail@xxx.com>".

Change-Id: I42cc399e79b65928a6aef87c51e5476c7158d166
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73340
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
This commit is contained in:
Zheng Bao 2023-03-01 12:35:14 +08:00 committed by Lean Sheng Tan
parent 247ec33eb9
commit e8183599ae
1 changed files with 1 additions and 1 deletions

View File

@ -166,7 +166,7 @@ _gen_ChangeId() {
git hash-object -t commit --stdin
}
if ! grep -qi '^[[:space:]]*Signed-off-by:' "$MSG"; then
if ! grep -qi '^[[:space:]]*Signed-off-by:.\+<.\+@.\+>' "$MSG"; then
printf "\nError: No Signed-off-by line in the commit message.\n"
exit 1
fi