qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails
@ 2020-06-29 17:27 Philippe Mathieu-Daudé
  2020-07-01 14:25 ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-06-29 17:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Philippe Mathieu-Daudé, Richard Henderson

Sometime emails get rejected and 'bounce'. It might take time
between we report that, a patch is posted, reviewed, merged...

To reduce time spent looking at bouncing emails in one mailbox,
add the feature to simply ignore broken email addresses. The
format is similar to the '.mailmap' file. Add an email address
in your local '.ignoredmailmap. and get_maintainer.pl won't
list it anymore.

This is particularly useful when git-send-email is used with
the --cc-cmd argument, like suggested in QEMU wiki:
https://wiki.qemu.org/Contribute/SubmitAPatch#CC_the_relevant_maintainer

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 scripts/get_maintainer.pl | 50 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 271f5ff42a..7f7a4ff3ef 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -38,6 +38,7 @@
 my $interactive = 0;
 my $email_remove_duplicates = 1;
 my $email_use_mailmap = 1;
+my $email_use_ignoredmailmap = 1;
 my $output_multiline = 1;
 my $output_separator = ", ";
 my $output_roles = 0;
@@ -365,6 +366,51 @@ sub read_mailmap {
     close($mailmap_file);
 }
 
+my $ignoredmailmap;
+
+read_ignoredmailmap();
+
+sub read_ignoredmailmap {
+    $ignoredmailmap = {
+	names => {},
+	addresses => {}
+    };
+
+    return if (!$email_use_ignoredmailmap || !(-f "${lk_path}.ignoredmailmap"));
+
+    open(my $ignoredmailmap_file, '<', "${lk_path}.ignoredmailmap")
+	or warn "$P: Can't open .ignoredmailmap: $!\n";
+
+    while (<$ignoredmailmap_file>) {
+	s/#.*$//; #strip comments
+	s/^\s+|\s+$//g; #trim
+
+	next if (/^\s*$/); #skip empty lines
+	#entries have one of the following formats:
+	# name1 <mail1>
+	# <mail1>
+
+	if (/^([^<]+)<([^>]+)>$/) {
+	    my $real_name = $1;
+	    my $address = $2;
+
+	    $real_name =~ s/\s+$//;
+	    ($real_name, $address) = parse_email("$real_name <$address>");
+	    $ignoredmailmap->{$address} = 1;
+	} elsif (/^(.+)<([^>]+)>\s*<([^>]+)>$/) {
+	    my $real_name = $1;
+	    my $real_address = $2;
+	    my $wrong_address = $3;
+
+	    $real_name =~ s/\s+$//;
+	    ($real_name, $real_address) =
+		parse_email("$real_name <$real_address>");
+	    $ignoredmailmap->{$real_address} = 1;
+	}
+    }
+    close($ignoredmailmap_file);
+}
+
 ## use the filenames on the command line or find the filenames in the patchfiles
 
 my @files = ();
@@ -1074,6 +1120,10 @@ sub push_email_address {
     if ($address eq "") {
 	return 0;
     }
+    if (exists $ignoredmailmap->{$address}) {
+        #warn("Ignoring address: '" . $address . "'\n");
+        return 0;
+    }
 
     if (!$email_remove_duplicates) {
 	push(@email_to, [format_email($name, $address, $email_usename), $role]);
-- 
2.21.3



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

* Re: [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails
  2020-06-29 17:27 [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails Philippe Mathieu-Daudé
@ 2020-07-01 14:25 ` Paolo Bonzini
  2020-07-01 15:07   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2020-07-01 14:25 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Richard Henderson

On 29/06/20 19:27, Philippe Mathieu-Daudé wrote:
> Sometime emails get rejected and 'bounce'. It might take time
> between we report that, a patch is posted, reviewed, merged...
> 
> To reduce time spent looking at bouncing emails in one mailbox,
> add the feature to simply ignore broken email addresses. The
> format is similar to the '.mailmap' file. Add an email address
> in your local '.ignoredmailmap. and get_maintainer.pl won't
> list it anymore.
> 
> This is particularly useful when git-send-email is used with
> the --cc-cmd argument, like suggested in QEMU wiki:
> https://wiki.qemu.org/Contribute/SubmitAPatch#CC_the_relevant_maintainer
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Do you have such a list already?

Paolo

> ---
>  scripts/get_maintainer.pl | 50 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
> 
> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
> index 271f5ff42a..7f7a4ff3ef 100755
> --- a/scripts/get_maintainer.pl
> +++ b/scripts/get_maintainer.pl
> @@ -38,6 +38,7 @@
>  my $interactive = 0;
>  my $email_remove_duplicates = 1;
>  my $email_use_mailmap = 1;
> +my $email_use_ignoredmailmap = 1;
>  my $output_multiline = 1;
>  my $output_separator = ", ";
>  my $output_roles = 0;
> @@ -365,6 +366,51 @@ sub read_mailmap {
>      close($mailmap_file);
>  }
>  
> +my $ignoredmailmap;
> +
> +read_ignoredmailmap();
> +
> +sub read_ignoredmailmap {
> +    $ignoredmailmap = {
> +	names => {},
> +	addresses => {}
> +    };
> +
> +    return if (!$email_use_ignoredmailmap || !(-f "${lk_path}.ignoredmailmap"));
> +
> +    open(my $ignoredmailmap_file, '<', "${lk_path}.ignoredmailmap")
> +	or warn "$P: Can't open .ignoredmailmap: $!\n";
> +
> +    while (<$ignoredmailmap_file>) {
> +	s/#.*$//; #strip comments
> +	s/^\s+|\s+$//g; #trim
> +
> +	next if (/^\s*$/); #skip empty lines
> +	#entries have one of the following formats:
> +	# name1 <mail1>
> +	# <mail1>
> +
> +	if (/^([^<]+)<([^>]+)>$/) {
> +	    my $real_name = $1;
> +	    my $address = $2;
> +
> +	    $real_name =~ s/\s+$//;
> +	    ($real_name, $address) = parse_email("$real_name <$address>");
> +	    $ignoredmailmap->{$address} = 1;
> +	} elsif (/^(.+)<([^>]+)>\s*<([^>]+)>$/) {
> +	    my $real_name = $1;
> +	    my $real_address = $2;
> +	    my $wrong_address = $3;
> +
> +	    $real_name =~ s/\s+$//;
> +	    ($real_name, $real_address) =
> +		parse_email("$real_name <$real_address>");
> +	    $ignoredmailmap->{$real_address} = 1;
> +	}
> +    }
> +    close($ignoredmailmap_file);
> +}
> +
>  ## use the filenames on the command line or find the filenames in the patchfiles
>  
>  my @files = ();
> @@ -1074,6 +1120,10 @@ sub push_email_address {
>      if ($address eq "") {
>  	return 0;
>      }
> +    if (exists $ignoredmailmap->{$address}) {
> +        #warn("Ignoring address: '" . $address . "'\n");
> +        return 0;
> +    }
>  
>      if (!$email_remove_duplicates) {
>  	push(@email_to, [format_email($name, $address, $email_usename), $role]);
> 



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

* Re: [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails
  2020-07-01 14:25 ` Paolo Bonzini
@ 2020-07-01 15:07   ` Philippe Mathieu-Daudé
  2020-07-01 15:12     ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-01 15:07 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: Richard Henderson

On 7/1/20 4:25 PM, Paolo Bonzini wrote:
> On 29/06/20 19:27, Philippe Mathieu-Daudé wrote:
>> Sometime emails get rejected and 'bounce'. It might take time
>> between we report that, a patch is posted, reviewed, merged...
>>
>> To reduce time spent looking at bouncing emails in one mailbox,
>> add the feature to simply ignore broken email addresses. The
>> format is similar to the '.mailmap' file. Add an email address
>> in your local '.ignoredmailmap. and get_maintainer.pl won't
>> list it anymore.
>>
>> This is particularly useful when git-send-email is used with
>> the --cc-cmd argument, like suggested in QEMU wiki:
>> https://wiki.qemu.org/Contribute/SubmitAPatch#CC_the_relevant_maintainer
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Do you have such a list already?

$ cat .ignoredmailmap
#
# From man git-shortlog the forms are:
#
#  Proper Name <commit@email.xx>
#  <proper@email.xx>
#
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Caio Carrara <ccarrara@redhat.com>
Yongbok Kim <yongbok.kim@mips.com>
James Hogan <james.hogan@mips.com>
Paul Burton <pburton@wavecomp.com>
Alexander Graf <agraf@suse.de>
Roy Franz <roy.franz@linaro.org>
Dmitry Solodkiy <d.solodkiy@samsung.com>
Evgeny Voevodin <e.voevodin@samsung.com>
Serge Hallyn <serge.hallyn@ubuntu.com>
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>

> 
> Paolo
> 
>> ---
>>  scripts/get_maintainer.pl | 50 +++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 50 insertions(+)
>>
>> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
>> index 271f5ff42a..7f7a4ff3ef 100755
>> --- a/scripts/get_maintainer.pl
>> +++ b/scripts/get_maintainer.pl
>> @@ -38,6 +38,7 @@
>>  my $interactive = 0;
>>  my $email_remove_duplicates = 1;
>>  my $email_use_mailmap = 1;
>> +my $email_use_ignoredmailmap = 1;
>>  my $output_multiline = 1;
>>  my $output_separator = ", ";
>>  my $output_roles = 0;
>> @@ -365,6 +366,51 @@ sub read_mailmap {
>>      close($mailmap_file);
>>  }
>>  
>> +my $ignoredmailmap;
>> +
>> +read_ignoredmailmap();
>> +
>> +sub read_ignoredmailmap {
>> +    $ignoredmailmap = {
>> +	names => {},
>> +	addresses => {}
>> +    };
>> +
>> +    return if (!$email_use_ignoredmailmap || !(-f "${lk_path}.ignoredmailmap"));
>> +
>> +    open(my $ignoredmailmap_file, '<', "${lk_path}.ignoredmailmap")
>> +	or warn "$P: Can't open .ignoredmailmap: $!\n";
>> +
>> +    while (<$ignoredmailmap_file>) {
>> +	s/#.*$//; #strip comments
>> +	s/^\s+|\s+$//g; #trim
>> +
>> +	next if (/^\s*$/); #skip empty lines
>> +	#entries have one of the following formats:
>> +	# name1 <mail1>
>> +	# <mail1>
>> +
>> +	if (/^([^<]+)<([^>]+)>$/) {
>> +	    my $real_name = $1;
>> +	    my $address = $2;
>> +
>> +	    $real_name =~ s/\s+$//;
>> +	    ($real_name, $address) = parse_email("$real_name <$address>");
>> +	    $ignoredmailmap->{$address} = 1;
>> +	} elsif (/^(.+)<([^>]+)>\s*<([^>]+)>$/) {
>> +	    my $real_name = $1;
>> +	    my $real_address = $2;
>> +	    my $wrong_address = $3;
>> +
>> +	    $real_name =~ s/\s+$//;
>> +	    ($real_name, $real_address) =
>> +		parse_email("$real_name <$real_address>");
>> +	    $ignoredmailmap->{$real_address} = 1;
>> +	}
>> +    }
>> +    close($ignoredmailmap_file);
>> +}
>> +
>>  ## use the filenames on the command line or find the filenames in the patchfiles
>>  
>>  my @files = ();
>> @@ -1074,6 +1120,10 @@ sub push_email_address {
>>      if ($address eq "") {
>>  	return 0;
>>      }
>> +    if (exists $ignoredmailmap->{$address}) {
>> +        #warn("Ignoring address: '" . $address . "'\n");
>> +        return 0;
>> +    }
>>  
>>      if (!$email_remove_duplicates) {
>>  	push(@email_to, [format_email($name, $address, $email_usename), $role]);
>>
> 
> 


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

* Re: [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails
  2020-07-01 15:07   ` Philippe Mathieu-Daudé
@ 2020-07-01 15:12     ` Paolo Bonzini
  2020-07-01 16:54       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2020-07-01 15:12 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Richard Henderson

On 01/07/20 17:07, Philippe Mathieu-Daudé wrote:
> $ cat .ignoredmailmap
> #
> # From man git-shortlog the forms are:
> #
> #  Proper Name <commit@email.xx>
> #  <proper@email.xx>
> #
> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Caio Carrara <ccarrara@redhat.com>
> Yongbok Kim <yongbok.kim@mips.com>
> James Hogan <james.hogan@mips.com>
> Paul Burton <pburton@wavecomp.com>
> Alexander Graf <agraf@suse.de>
> Roy Franz <roy.franz@linaro.org>
> Dmitry Solodkiy <d.solodkiy@samsung.com>
> Evgeny Voevodin <e.voevodin@samsung.com>
> Serge Hallyn <serge.hallyn@ubuntu.com>
> Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> 

For at least Paul Burton, Pavel Dovgalyuk and Alex Graf we should just
use .mailmap, anyway I think the concept of the patch is okay.

Paolo



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

* Re: [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails
  2020-07-01 15:12     ` Paolo Bonzini
@ 2020-07-01 16:54       ` Philippe Mathieu-Daudé
  2020-07-01 19:51         ` Alexander Graf
  2020-07-02  5:54         ` Pavel Dovgalyuk
  0 siblings, 2 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-01 16:54 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel
  Cc: Pavel Dovgalyuk, Alexander Graf, Paul Burton, Pavel Dovgalyuk,
	Richard Henderson

+Pavel/Paul/Alexander

On 7/1/20 5:12 PM, Paolo Bonzini wrote:
> On 01/07/20 17:07, Philippe Mathieu-Daudé wrote:
>> $ cat .ignoredmailmap
>> #
>> # From man git-shortlog the forms are:
>> #
>> #  Proper Name <commit@email.xx>
>> #  <proper@email.xx>
>> #
>> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> Caio Carrara <ccarrara@redhat.com>
>> Yongbok Kim <yongbok.kim@mips.com>
>> James Hogan <james.hogan@mips.com>
>> Paul Burton <pburton@wavecomp.com>
>> Alexander Graf <agraf@suse.de>
>> Roy Franz <roy.franz@linaro.org>
>> Dmitry Solodkiy <d.solodkiy@samsung.com>
>> Evgeny Voevodin <e.voevodin@samsung.com>
>> Serge Hallyn <serge.hallyn@ubuntu.com>
>> Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
>>
> 
> For at least Paul Burton, Pavel Dovgalyuk and Alex Graf we should just
> use .mailmap, anyway I think the concept of the patch is okay.

Pavel has been using a GMail account, but seems to be back to
ispras.ru, so it might have be a temporary failure (over few
days although).

I can send a pair of patches for Paul and Alexander if they
are OK. The others seem MIA.

> 
> Paolo
> 
> 


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

* Re: [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails
  2020-07-01 16:54       ` Philippe Mathieu-Daudé
@ 2020-07-01 19:51         ` Alexander Graf
  2020-07-02  5:54         ` Pavel Dovgalyuk
  1 sibling, 0 replies; 7+ messages in thread
From: Alexander Graf @ 2020-07-01 19:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Paolo Bonzini, qemu-devel
  Cc: Pavel Dovgalyuk, Paul Burton, Pavel Dovgalyuk, Richard Henderson



On 01.07.20 18:54, Philippe Mathieu-Daudé wrote:
> 
> +Pavel/Paul/Alexander
> 
> On 7/1/20 5:12 PM, Paolo Bonzini wrote:
>> On 01/07/20 17:07, Philippe Mathieu-Daudé wrote:
>>> $ cat .ignoredmailmap
>>> #
>>> # From man git-shortlog the forms are:
>>> #
>>> #  Proper Name <commit@email.xx>
>>> #  <proper@email.xx>
>>> #
>>> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>>> Caio Carrara <ccarrara@redhat.com>
>>> Yongbok Kim <yongbok.kim@mips.com>
>>> James Hogan <james.hogan@mips.com>
>>> Paul Burton <pburton@wavecomp.com>
>>> Alexander Graf <agraf@suse.de>
>>> Roy Franz <roy.franz@linaro.org>
>>> Dmitry Solodkiy <d.solodkiy@samsung.com>
>>> Evgeny Voevodin <e.voevodin@samsung.com>
>>> Serge Hallyn <serge.hallyn@ubuntu.com>
>>> Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
>>>
>>
>> For at least Paul Burton, Pavel Dovgalyuk and Alex Graf we should just
>> use .mailmap, anyway I think the concept of the patch is okay.
> 
> Pavel has been using a GMail account, but seems to be back to
> ispras.ru, so it might have be a temporary failure (over few
> days although).
> 
> I can send a pair of patches for Paul and Alexander if they
> are OK. The others seem MIA.

Yes, please! I would appreciate if you could use agraf@csgraf.de for 
QEMU related work :).


Alex


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

* Re: [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails
  2020-07-01 16:54       ` Philippe Mathieu-Daudé
  2020-07-01 19:51         ` Alexander Graf
@ 2020-07-02  5:54         ` Pavel Dovgalyuk
  1 sibling, 0 replies; 7+ messages in thread
From: Pavel Dovgalyuk @ 2020-07-02  5:54 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Paolo Bonzini, qemu-devel
  Cc: Pavel Dovgalyuk, Alexander Graf, Paul Burton, Pavel Dovgalyuk,
	Richard Henderson

On 01.07.2020 19:54, Philippe Mathieu-Daudé wrote:
> +Pavel/Paul/Alexander
> 
> On 7/1/20 5:12 PM, Paolo Bonzini wrote:
>> On 01/07/20 17:07, Philippe Mathieu-Daudé wrote:
>>> $ cat .ignoredmailmap
>>> #
>>> # From man git-shortlog the forms are:
>>> #
>>> #  Proper Name <commit@email.xx>
>>> #  <proper@email.xx>
>>> #
>>> Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>>> Caio Carrara <ccarrara@redhat.com>
>>> Yongbok Kim <yongbok.kim@mips.com>
>>> James Hogan <james.hogan@mips.com>
>>> Paul Burton <pburton@wavecomp.com>
>>> Alexander Graf <agraf@suse.de>
>>> Roy Franz <roy.franz@linaro.org>
>>> Dmitry Solodkiy <d.solodkiy@samsung.com>
>>> Evgeny Voevodin <e.voevodin@samsung.com>
>>> Serge Hallyn <serge.hallyn@ubuntu.com>
>>> Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
>>>
>>
>> For at least Paul Burton, Pavel Dovgalyuk and Alex Graf we should just
>> use .mailmap, anyway I think the concept of the patch is okay.
> 
> Pavel has been using a GMail account, but seems to be back to
> ispras.ru, so it might have be a temporary failure (over few
> days although).

Right, my primary e-mail for QEMU-related work was pavel.dovgaluk@ispras.ru.
However, I recently added alias with better transliteration 
(Pavel.Dovgalyuk@ispras.ru), and now I will use it for the patches.

> 
> I can send a pair of patches for Paul and Alexander if they
> are OK. The others seem MIA.
> 
>>
>> Paolo
>>
>>



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

end of thread, other threads:[~2020-07-02  5:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 17:27 [PATCH] scripts/get_maintainer: Use .ignoredmailmap to ignore invalid emails Philippe Mathieu-Daudé
2020-07-01 14:25 ` Paolo Bonzini
2020-07-01 15:07   ` Philippe Mathieu-Daudé
2020-07-01 15:12     ` Paolo Bonzini
2020-07-01 16:54       ` Philippe Mathieu-Daudé
2020-07-01 19:51         ` Alexander Graf
2020-07-02  5:54         ` Pavel Dovgalyuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).