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

Daniel Vetter daniel at ffwll.ch
Wed Jul 26 12:11:38 UTC 2017


On Wed, Jul 26, 2017 at 02:07:49PM +0200, Benjamin Gaignard wrote:
> 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

Thanks for respinning, applied&pushed.
-Daniel

> 
>  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
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list