Skip to contentSkip to conversation

dim: Accept author x signed-off based on email, but warn.

PATCH In review Rodrigo Vivi 4 participants 13 messages Sep 19, 2017 – Sep 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dim: Accept author x signed-off based on email, but warn.

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 <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 dim | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
dim +6 -1
index dbaeb1ec944d..13cc5f00209d 100755
@@ -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
Signature · 6 lines
2.13.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 22 lines · 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 <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 dim | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
dim +0 -0
index dbaeb1ec944d..13cc5f00209d 100755

dim function checkpatch_commit_push · line 698

Quoted 10 lines
dim +2 -1
@@ -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... ;)

dim function checkpatch_commit_push · line 699

Quoted 1 line
dim +1 -0
+			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!

dim function checkpatch_commit_push · line 701

Quoted 2 lines
dim +2 -0
+		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.

Quoted 4 lines
dim +1 -0
+		fi
 	fi
 
 	# check for committer sign-off
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
In reply to Rodrigo Vivi
Quoted 4 lines · 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.

+ Arek,

Wasn't this trouble supposed to be fixed?

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 9 lines · Joonas Lahtinen
Quoted 4 lines · 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.

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

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 7 lines · Jani Nikula
Quoted 6 lines · Joonas Lahtinen
Quoted 4 lines · 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.

Quoted 8 lines
Quoted 3 lines

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

Quoted 7 lines

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

PATCH 1/1 dim: Accept author x signed-off based on email.

In reply to Jani Nikula

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.

v2: Avoid useles warning and only check for email.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +1 -1
index dbaeb1ec944d..a63000fb67a8 100755
@@ -689,7 +689,7 @@ function checkpatch_commit_push
 	sha1=$1
 
 	# use real names for people with many different email addresses
-	author=$(git show -s $sha1 --format="format:%an")
+	author=$(git show -s $sha1 --format="format:%ae")
 	committer=$(git show -s $sha1 --format="format:%cn")
 
 	# check for author sign-off
Signature · 6 lines
2.13.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#6 lore raw

Re: [PATCH] dim: Accept author x signed-off based on email.

Quoted 5 lines · 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.

Quoted 7 lines

So, let's check for email addresses instead.

v2: Avoid useles warning and only check for email.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Quoted 17 lines
---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +1 -1
index dbaeb1ec944d..a63000fb67a8 100755
@@ -689,7 +689,7 @@ function checkpatch_commit_push
 	sha1=$1
 
 	# use real names for people with many different email addresses
-	author=$(git show -s $sha1 --format="format:%an")
+	author=$(git show -s $sha1 --format="format:%ae")
 	committer=$(git show -s $sha1 --format="format:%cn")
 
 	# check for author sign-off
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

Re: [PATCH] dim: Accept author x signed-off based on email.

Quoted 8 lines · Jani Nikula
Quoted 7 lines · 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.

Quoted 7 lines
Quoted 5 lines

v2: Avoid useles warning and only check for email.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>

pushed, thanks.

Quoted 12 lines
Quoted 12 lines
---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +0 -0
index dbaeb1ec944d..a63000fb67a8 100755
@@ -689,7 +689,7 @@ function checkpatch_commit_push
 	sha1=$1
 
Quoted 9 lines
Quoted 6 lines
dim +1 -1
 	# use real names for people with many different email addresses
-	author=$(git show -s $sha1 --format="format:%an")
+	author=$(git show -s $sha1 --format="format:%ae")
 	committer=$(git show -s $sha1 --format="format:%cn")
 
 	# check for author sign-off
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

Re: [PATCH] dim: Accept author x signed-off based on email.

Quoted 11 lines · Rodrigo Vivi
Quoted 10 lines · Jani Nikula
Quoted 9 lines · 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.

v2: Avoid useles warning and only check for email.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>

pushed, thanks.

Yeah except this breaks funny people like me who use different mails for stuff. My idea with fixing this was that we parse the mail name and check for both "Last, First" and "First Last" to work around the outlook crap.

I really don't want to send mail from @intel.com to anywhere near public stuff.
-Daniel

Quoted 26 lines
Quoted 13 lines
Quoted 13 lines

---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +0 -0
index dbaeb1ec944d..a63000fb67a8 100755
@@ -689,7 +689,7 @@ function checkpatch_commit_push
 	sha1=$1
 
Quoted 9 lines
Quoted 6 lines
dim +1 -1
 	# use real names for people with many different email addresses
-	author=$(git show -s $sha1 --format="format:%an")
+	author=$(git show -s $sha1 --format="format:%ae")
 	committer=$(git show -s $sha1 --format="format:%cn")
 
 	# check for author sign-off
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH] dim: Accept author x signed-off based on email.

Quoted 18 lines · Daniel Vetter
Quoted 17 lines · Rodrigo Vivi
Quoted 15 lines · Jani Nikula
Quoted 5 lines · 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.

Quoted 7 lines

So, let's check for email addresses instead.

v2: Avoid useles warning and only check for email.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Quoted 8 lines
Quoted 1 line

pushed, thanks.

Yeah except this breaks funny people like me who use different mails for stuff. My idea with fixing this was that we parse the mail name and check for both "Last, First" and "First Last" to work around the outlook crap.

I really don't want to send mail from @intel.com to anywhere near public stuff.

Ok, I'm fine with reverting, and finding another way.

BR,
Jani.

Quoted 28 lines

-Daniel

Quoted 26 lines
Quoted 13 lines
Quoted 13 lines

---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +0 -0
index dbaeb1ec944d..a63000fb67a8 100755
@@ -689,7 +689,7 @@ function checkpatch_commit_push
 	sha1=$1
 
Quoted 9 lines
Quoted 6 lines
dim +1 -1
 	# use real names for people with many different email addresses
-	author=$(git show -s $sha1 --format="format:%an")
+	author=$(git show -s $sha1 --format="format:%ae")
 	committer=$(git show -s $sha1 --format="format:%cn")
 
 	# check for author sign-off
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

Re: [PATCH] dim: Accept author x signed-off based on email.

Quoted 17 lines · Jani Nikula
Quoted 16 lines · Daniel Vetter
Quoted 15 lines · Rodrigo Vivi
Quoted 14 lines · Jani Nikula
Quoted 12 lines · 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.

v2: Avoid useles warning and only check for email.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

pushed, thanks.

Yeah except this breaks funny people like me who use different mails for stuff. My idea with fixing this was that we parse the mail name and check for both "Last, First" and "First Last" to work around the outlook crap.

The name parsing with last and first can be really nasty and end up having other corner cases soon.

Like, my legal name in us is still:
de Oliveira Vivi, Rodrigo
not
Vivi, Rodrigo de Oliveira

I can imagine many other possible combinations with this and other names.

Quoted 3 lines
Quoted 3 lines

I really don't want to send mail from @intel.com to anywhere near public stuff.

I'm not sure if it is outlook fault honestly. On my patches where this funny mess happenend I checked my email on the mailing list and original and everything seemed sane there. The only place where Last, First started was post pwclient.

Quoted 2 lines

Ok, I'm fine with reverting, and finding another way.

I'm fine with the revert as well, but before reverting let me propose one thing that is name_match || email_match so we cover both cases.

What do you think?

Quoted 24 lines

BR,
Jani.

Quoted 20 lines

-Daniel

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +1 -1
index dbaeb1ec944d..a63000fb67a8 100755
@@ -689,7 +689,7 @@ function checkpatch_commit_push
 	sha1=$1
 
 	# use real names for people with many different email addresses
-	author=$(git show -s $sha1 --format="format:%an")
+	author=$(git show -s $sha1 --format="format:%ae")
 	committer=$(git show -s $sha1 --format="format:%cn")
 
Quoted 11 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
dim +0 -0
 	# check for author sign-off
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#11 lore raw

Re: [PATCH] dim: Accept author x signed-off based on email.

Quoted 29 lines · Rodrigo Vivi
Quoted 17 lines · Jani Nikula
Quoted 16 lines · Daniel Vetter
Quoted 15 lines · Rodrigo Vivi
Quoted 14 lines · Jani Nikula
Quoted 12 lines · 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.

v2: Avoid useles warning and only check for email.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

pushed, thanks.

Yeah except this breaks funny people like me who use different mails for stuff. My idea with fixing this was that we parse the mail name and check for both "Last, First" and "First Last" to work around the outlook crap.

The name parsing with last and first can be really nasty and end up having other corner cases soon.

Quoted 6 lines

Like, my legal name in us is still:
de Oliveira Vivi, Rodrigo
not
Vivi, Rodrigo de Oliveira

I can imagine many other possible combinations with this and other names.

Luckily you're only Rodrigo Vivi in intel's system, so we're passing.

But yes, we probably need to check all possible combos for where we could place the comma.

Quoted 10 lines
Quoted 4 lines
Quoted 4 lines

I really don't want to send mail from @intel.com to anywhere near public stuff.

I'm not sure if it is outlook fault honestly. On my patches where this funny mess happenend I checked my email on the mailing list and original and everything seemed sane there. The only place where Last, First started was post pwclient.

Quoted 1 line
Quoted 6 lines
Quoted 1 line

Ok, I'm fine with reverting, and finding another way.

I'm fine with the revert as well, but before reverting let me propose one thing that is name_match || email_match so we cover both cases.

What do you think?

I sent out a patch, pls test for your cases. I'll be happy to amend. -Daniel

Quoted 36 lines
Quoted 36 lines

BR,
Jani.

Quoted 28 lines

-Daniel

Quoted 26 lines
Quoted 13 lines
Quoted 13 lines

---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +0 -0
index dbaeb1ec944d..a63000fb67a8 100755
@@ -689,7 +689,7 @@ function checkpatch_commit_push
 	sha1=$1
 
Quoted 9 lines
Quoted 6 lines
dim +1 -1
 	# use real names for people with many different email addresses
-	author=$(git show -s $sha1 --format="format:%an")
+	author=$(git show -s $sha1 --format="format:%ae")
 	committer=$(git show -s $sha1 --format="format:%cn")
 
 	# check for author sign-off
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

Re: [PATCH] dim: Accept author x signed-off based on email.

Quoted 30 lines · Daniel Vetter
Quoted 29 lines · Rodrigo Vivi
Quoted 17 lines · Jani Nikula
Quoted 16 lines · Daniel Vetter
Quoted 15 lines · Rodrigo Vivi
Quoted 14 lines · Jani Nikula
Quoted 12 lines · 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.

v2: Avoid useles warning and only check for email.

Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

pushed, thanks.

Yeah except this breaks funny people like me who use different mails for stuff. My idea with fixing this was that we parse the mail name and check for both "Last, First" and "First Last" to work around the outlook crap.

The name parsing with last and first can be really nasty and end up having other corner cases soon.

Quoted 8 lines
Quoted 6 lines

Like, my legal name in us is still:
de Oliveira Vivi, Rodrigo
not
Vivi, Rodrigo de Oliveira

I can imagine many other possible combinations with this and other names.

Luckily you're only Rodrigo Vivi in intel's system, so we're passing.

my one was just the first example that came to my mind ;)

Quoted 3 lines

But yes, we probably need to check all possible combos for where we could place the comma.

yep, because my name wasn't the problem on the fixes branches flow. Others names end up merged with last, name.

Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
Quoted 5 lines

I really don't want to send mail from @intel.com to anywhere near public stuff.

I'm not sure if it is outlook fault honestly. On my patches where this funny mess happenend I checked my email on the mailing list and original and everything seemed sane there. The only place where Last, First started was post pwclient.

Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Ok, I'm fine with reverting, and finding another way.

I'm fine with the revert as well, but before reverting let me propose one thing that is name_match || email_match so we cover both cases.

What do you think?

I sent out a patch, pls test for your cases. I'll be happy to amend.

lets move with those patches and if I get impacted on fixes flow later again I raise it back ;)

Quoted 31 lines

-Daniel

Quoted 29 lines
Quoted 29 lines

BR,
Jani.

Quoted 24 lines

-Daniel

Quoted 22 lines
Quoted 22 lines
Quoted 19 lines

---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +1 -1
index dbaeb1ec944d..a63000fb67a8 100755
@@ -689,7 +689,7 @@ function checkpatch_commit_push
 	sha1=$1
 
 	# use real names for people with many different email addresses
-	author=$(git show -s $sha1 --format="format:%an")
+	author=$(git show -s $sha1 --format="format:%ae")
 	committer=$(git show -s $sha1 --format="format:%cn")
 
 	# check for author sign-off
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Quoted 12 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx