Skip to contentSkip to conversation

get_maintainer.pl: restrict cases where it falls back to --git

PATCH In review Paolo Bonzini 2 participants 3 messages Oct 22, 2014 GET_MAINTAINER script

lore
Share & tools
lore
#0 lore raw

PATCH v2 4/4 get_maintainer.pl: restrict cases where it falls back to --git

The list emitted by --git-fallback often leads inexperienced contributors to add pointless CCs. While not discouraging usage of --git-fallback, we want to:

1) disable the fallback if only some files lack a maintainer

    $ scripts/get_maintainer.pl -f util/cutils.c hw/ide/core.c
    Kevin Wolf <[email protected]> (odd fixer:IDE)
    Stefan Hajnoczi <[email protected]> (odd fixer:IDE)

This behavior is taken even if --git-fallback is specified.

2) warn the contributors about what we're doing, asking them to use their common sense:

    $ scripts/get_maintainer.pl -f util/cutils.c
    get_maintainer.pl: No maintainers found, printing recent contributors.
    get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.
    Luiz Capitulino <[email protected]> (commit_signer:1/2=50%)
    ...
    $

Explicitly disabling the fallback will not result in the warning message:

    $ scripts/get_maintainer.pl -f util/cutils.c   --no-git-fallback
    $ echo $?
    1
---
 scripts/get_maintainer.pl | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/get_maintainer.pl +9 -0
index 7c6d186..f4fee27 100755
@@ -633,6 +633,15 @@ sub get_maintainers {
     }
 
     if ($email) {
+	if (! $interactive) {
+	    $email_git_fallback = 0 if @email_to > 0 || @list_to > 0 || $email_git || $email_git_blame;
+	    if ($email_git_fallback) {
+	        print STDERR "get_maintainer.pl: No maintainers found, printing recent contributors.\n";
+	        print STDERR "get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.\n";
+	        print STDERR "\n";
+            }
+        }
+
 	foreach my $file (@files) {
 	    if ($email_git || ($email_git_fallback &&
 			       !$exact_pattern_match_hash{$file})) {
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 44 lines · Paolo Bonzini

The list emitted by --git-fallback often leads inexperienced contributors to add pointless CCs. While not discouraging usage of --git-fallback, we want to:

1) disable the fallback if only some files lack a maintainer

    $ scripts/get_maintainer.pl -f util/cutils.c hw/ide/core.c
    Kevin Wolf <[email protected]> (odd fixer:IDE)
    Stefan Hajnoczi <[email protected]> (odd fixer:IDE)

This behavior is taken even if --git-fallback is specified.

2) warn the contributors about what we're doing, asking them to use their common sense:

    $ scripts/get_maintainer.pl -f util/cutils.c
    get_maintainer.pl: No maintainers found, printing recent contributors.
    get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.
    Luiz Capitulino <[email protected]> (commit_signer:1/2=50%)
    ...
    $

Explicitly disabling the fallback will not result in the warning message:

    $ scripts/get_maintainer.pl -f util/cutils.c   --no-git-fallback
    $ echo $?
    1
---
 scripts/get_maintainer.pl | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/get_maintainer.pl +2 -0
index 7c6d186..f4fee27 100755
@@ -633,6 +633,15 @@ sub get_maintainers {
     }
 
     if ($email) {
+	if (! $interactive) {
+	    $email_git_fallback = 0 if @email_to > 0 || @list_to > 0 || $email_git || $email_git_blame;

scripts/get_maintainer.pl sub get_maintainers { · line 647

Quoted 10 lines
scripts/get_maintainer.pl +7 -0
+	    if ($email_git_fallback) {
+	        print STDERR "get_maintainer.pl: No maintainers found, printing recent contributors.\n";
+	        print STDERR "get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.\n";
+	        print STDERR "\n";
+            }
+        }
+
 	foreach my $file (@files) {
 	    if ($email_git || ($email_git_fallback &&
 			       !$exact_pattern_match_hash{$file})) {

I liked v1 better.

#2 lore raw
Quoted 43 lines · Markus Armbruster
Quoted 41 lines · Paolo Bonzini

The list emitted by --git-fallback often leads inexperienced contributors to add pointless CCs. While not discouraging usage of --git-fallback, we want to:

1) disable the fallback if only some files lack a maintainer

    $ scripts/get_maintainer.pl -f util/cutils.c hw/ide/core.c
    Kevin Wolf <[email protected]> (odd fixer:IDE)
    Stefan Hajnoczi <[email protected]> (odd fixer:IDE)

This behavior is taken even if --git-fallback is specified.

2) warn the contributors about what we're doing, asking them to use their common sense:

    $ scripts/get_maintainer.pl -f util/cutils.c
    get_maintainer.pl: No maintainers found, printing recent contributors.
    get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.
    Luiz Capitulino <[email protected]> (commit_signer:1/2=50%)
    ...
    $

Explicitly disabling the fallback will not result in the warning message:

    $ scripts/get_maintainer.pl -f util/cutils.c   --no-git-fallback
    $ echo $?
    1
---
 scripts/get_maintainer.pl | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/get_maintainer.pl +0 -0
index 7c6d186..f4fee27 100755
@@ -633,6 +633,15 @@ sub get_maintainers {
     }
 
Quoted 15 lines

scripts/get_maintainer.pl sub get_maintainers { · line 647

Quoted 13 lines
scripts/get_maintainer.pl +9 -0
     if ($email) {
+	if (! $interactive) {
+	    $email_git_fallback = 0 if @email_to > 0 || @list_to > 0 || $email_git || $email_git_blame;
+	    if ($email_git_fallback) {
+	        print STDERR "get_maintainer.pl: No maintainers found, printing recent contributors.\n";
+	        print STDERR "get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.\n";
+	        print STDERR "\n";
+            }
+        }
+
 	foreach my $file (@files) {
 	    if ($email_git || ($email_git_fallback &&
 			       !$exact_pattern_match_hash{$file})) {

I liked v1 better.

Me too, but we can start with this. It's better than the status quo, and the difference overall is small (the important part is disabling fallback---with no message---on @email_to || @list_to).

Paolo