All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dim: add checks for author and committer sign-off-by
@ 2017-07-26 12:07 Benjamin Gaignard
  2017-07-26 12:11 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Gaignard @ 2017-07-26 12:07 UTC (permalink / raw)
  To: dri-devel, daniel.vetter, seanpaul

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] dim: add checks for author and committer sign-off-by
  2017-07-26 12:07 [PATCH v2] dim: add checks for author and committer sign-off-by Benjamin Gaignard
@ 2017-07-26 12:11 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2017-07-26 12:11 UTC (permalink / raw)
  To: Benjamin Gaignard; +Cc: daniel.vetter, dri-devel

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@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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-26 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 12:07 [PATCH v2] dim: add checks for author and committer sign-off-by Benjamin Gaignard
2017-07-26 12:11 ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.