Re: [Intel-gfx] [PATCH] dim: Accept author x signed-off based on email, but warn.

2017-09-20 Thread Rodrigo Vivi
On Wed, Sep 20, 2017 at 11:51:50AM +, Jani Nikula wrote:
> On Wed, 20 Sep 2017, Joonas Lahtinen  wrote:
> > On Tue, 2017-09-19 at 10:48 -0700, Rodrigo Vivi wrote:
> >> It seems Patchwork or SMTP servers are messing some patches
> >> and changing the original git's author name on git per "Last, First".
> >> So we end up with a mismatch were signed-off uses one name format
> >> and author is using another format.
> >
> > + Arek,
> >
> > Wasn't this trouble supposed to be fixed?
> 
> Maybe in patchwork context, but it can still happen for people applying
> patches from their MUA. And I doubt it can be reliably "fixed" if the
> author intentionally or inadvertently has differing author and sob
> lines.

hmm... if this is possible we do need to only check for email and move one.

But anyways what I'm seeing a lot recently is this patchwork issue joonas 
mentioned.
I had to edit few of my patches recently because something on the way changed my
"name last" per "last, name".. and this seems exactly the case with one 
Manasi's and
one Lee's patch that was impacting the pull request flow.

So if the patchwork is fixed now I believe we can just change the check to email
instead of the name and move on...

Thanks,
Rodrigo.

> 
> BR,
> Jani.
> 
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] dim: Accept author x signed-off based on email, but warn.

2017-09-20 Thread Jani Nikula
On Wed, 20 Sep 2017, Joonas Lahtinen  wrote:
> On Tue, 2017-09-19 at 10:48 -0700, Rodrigo Vivi wrote:
>> It seems Patchwork or SMTP servers are messing some patches
>> and changing the original git's author name on git per "Last, First".
>> So we end up with a mismatch were signed-off uses one name format
>> and author is using another format.
>
> + Arek,
>
> Wasn't this trouble supposed to be fixed?

Maybe in patchwork context, but it can still happen for people applying
patches from their MUA. And I doubt it can be reliably "fixed" if the
author intentionally or inadvertently has differing author and sob
lines.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] dim: Accept author x signed-off based on email, but warn.

2017-09-20 Thread Joonas Lahtinen
On Tue, 2017-09-19 at 10:48 -0700, Rodrigo Vivi wrote:
> It seems Patchwork or SMTP servers are messing some patches
> and changing the original git's author name on git per "Last, First".
> So we end up with a mismatch were signed-off uses one name format
> and author is using another format.

+ Arek,

Wasn't this trouble supposed to be fixed?

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] dim: Accept author x signed-off based on email, but warn.

2017-09-20 Thread Jani Nikula
On Tue, 19 Sep 2017, Rodrigo Vivi  wrote:
> It seems Patchwork or SMTP servers are messing some patches
> and changing the original git's author name on git per "Last, First".
> So we end up with a mismatch were signed-off uses one name format
> and author is using another format.
>
> So, let's check for email addresses instead.
>
> However let's continue to WARN so commiters can take action on it
> before pushing patch upstream with incorrect "Last, First" name.
>
> Cc: Jani Nikula 
> Cc: Joonas Lahtinen 
> Signed-off-by: Rodrigo Vivi 
> ---
>  dim | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/dim b/dim
> index dbaeb1ec944d..13cc5f00209d 100755
> --- a/dim
> +++ b/dim
> @@ -690,11 +690,16 @@ function checkpatch_commit_push
>  
>   # use real names for people with many different email addresses
>   author=$(git show -s $sha1 --format="format:%an")
> + author_email=$(git show -s $sha1 --format="format:%ae")
>   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"
> + if git show -s $sha1 | grep -qi "S.*-by:.*$author_email"  ; then

No spaces required before ;. Even if it's copy-pasted from above... ;)

> + echoerr "WARNING: Author name mismatch. Patchwork or 
> SMTP messing it up. Consider fixing it before pushing it."

Please don't make any assumptions about what caused it. The user may
have configured it so.

But the real trouble is, it's too late anyway at this state. If this
succeeds, it'll already be pushed after it's done!

> + else
> + warn_or_fail "$sha1 is lacking author of sign-off"

Please fix this while at it, it doesn't make any sense. "$sha1 author
sign-off missing" or something.

> + fi
>   fi
>  
>   # check for committer sign-off

-- 
Jani Nikula, Intel Open Source Technology Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] dim: Accept author x signed-off based on email, but warn.

2017-09-19 Thread Rodrigo Vivi
It seems Patchwork or SMTP servers are messing some patches
and changing the original git's author name on git per "Last, First".
So we end up with a mismatch were signed-off uses one name format
and author is using another format.

So, let's check for email addresses instead.

However let's continue to WARN so commiters can take action on it
before pushing patch upstream with incorrect "Last, First" name.

Cc: Jani Nikula 
Cc: Joonas Lahtinen 
Signed-off-by: Rodrigo Vivi 
---
 dim | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index dbaeb1ec944d..13cc5f00209d 100755
--- a/dim
+++ b/dim
@@ -690,11 +690,16 @@ function checkpatch_commit_push
 
# use real names for people with many different email addresses
author=$(git show -s $sha1 --format="format:%an")
+   author_email=$(git show -s $sha1 --format="format:%ae")
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"
+   if git show -s $sha1 | grep -qi "S.*-by:.*$author_email"  ; then
+   echoerr "WARNING: Author name mismatch. Patchwork or 
SMTP messing it up. Consider fixing it before pushing it."
+   else
+   warn_or_fail "$sha1 is lacking author of sign-off"
+   fi
fi
 
# check for committer sign-off
-- 
2.13.5

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx