[PATCH v2] dim: add checks for author and committer sign-off-by

Benjamin Gaignard benjamin.gaignard at linaro.org
Wed Jul 26 12:07:49 UTC 2017


Add checks for author and committer sign-off-by.
Add a check for "Link" tag added by dim apply-branch.

Use real names for people with many different email addresses.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard at linaro.org>
---
version 2:
- keep the same logic than before for reviewed/acked-by checks
- use real names

 dim | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index 786fe6b..c0cbe35 100755
--- a/dim
+++ b/dim
@@ -662,13 +662,32 @@ function checkpatch_commit_push
 
 	sha1=$1
 
+	# use real names for people with many different email addresses
+	author=$(git show -s $sha1 --format="format:%an")
+	committer=$(git show -s $sha1 --format="format:%cn")
+
+	# check for author sign-off
+	if ! git show -s $sha1 | grep -qi "S.*-by:.*$author"  ; then
+		warn_or_fail "$sha1 is lacking author of sign-off"
+	fi
+
+	# check for committer sign-off
+	if ! git show -s $sha1 | grep -qi "S.*-by:.*$committer"  ; then
+		warn_or_fail "$sha1 is lacking committer of sign-off"
+	fi
+
+	# check for Link tag
+	if ! git show -s $sha1 | grep -qi 'Link:'  ; then
+		warn_or_fail "$sha1 is lacking of link tag"
+	fi
+
 	# check for a-b/r-b tag
 	if git show -s $sha1 | grep -qi '\(reviewed\|acked\)\S*-by:'  ; then
 		return
 	fi
 
 	# check for committer != author
-	if [[ $(git show -s $sha1 --format="format:%ce") != $(git show -s $sha1 --format="format:%ae") ]]; then
+	if [[ $committer  != $author ]]; then
 		return
 	fi
 
-- 
1.9.1



More information about the dri-devel mailing list