aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2023-03-11 23:43:42 +0100
committerMarc Poulhiès <dkm@kataplop.net>2023-03-23 07:55:37 +0000
commit7d38d01886da81d2c38673887dc8802efd0d5432 (patch)
treea74cda970577165a5740ee5c404a0e50c83b75a6
parentb623cb99ac1c176ecb50e127f7f1ed13eb714316 (diff)
downloadgcc-7d38d01886da81d2c38673887dc8802efd0d5432.zip
gcc-7d38d01886da81d2c38673887dc8802efd0d5432.tar.gz
gcc-7d38d01886da81d2c38673887dc8802efd0d5432.tar.bz2
ci: check Signed-off-by lines (and others) are at the end
Check Signed-off-by/Reviewed-by/Co-authored-by lines are all grouped and last in commit log. ChangeLog: * .github/workflows/commit-format.yml: Check SoB lines are last. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
-rw-r--r--.github/workflows/commit-format.yml20
1 files changed, 18 insertions, 2 deletions
diff --git a/.github/workflows/commit-format.yml b/.github/workflows/commit-format.yml
index 10cb5a0..9e89b92 100644
--- a/.github/workflows/commit-format.yml
+++ b/.github/workflows/commit-format.yml
@@ -91,6 +91,22 @@ jobs:
fi
done;
- exit $retval;
+ ## check no Signed-off-by in the middle.
+ while read -r f; do
+ echo -n "$f : "
+ if awk 'BEGIN { in_footer = 0; error = 0;}
+ { DEFAULT = 1; }
+ /^Signed-off-by/ { in_footer = 1; DEFAULT = 0;}
+ /^Co-authored-by/ { in_footer = 1; DEFAULT = 0;}
+ /^Reviewed-by/ { in_footer = 1; DEFAULT = 0;}
+ /^\s*$/ { DEFAULT = 0; }
+ DEFAULT { if (in_footer == 1) { printf $0 " appears after some Signed-off-by/Co-authored-by line "; error = 1; exit (1);} }';
+ then
+ echo OK
+ else
+ echo KO
+ retval=1
+ fi < <(git log "$f" -1 --format="%B")
+ done < <(git rev-list --reverse "$rev_list" )
-
+ exit $retval;