workflows.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Joe Perches <joe@perches.com>
Cc: workflows@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
	 Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	 Thorsten Leemhuis <linux@leemhuis.info>,
	Kees Cook <kees@kernel.org>,
	 linux-kernel@vger.kernel.org, Vlastimil Babka <vbabka@suse.cz>
Subject: [PATCH 2/2] get_maintainer: print subsystem status also for reviewers and lists
Date: Tue, 14 Jan 2025 09:57:55 +0100	[thread overview]
Message-ID: <20250114-b4-get_maintainer-v1-2-ecf40f0d032d@suse.cz> (raw)
In-Reply-To: <20250114-b4-get_maintainer-v1-0-ecf40f0d032d@suse.cz>

When reporting maintainers, the subsystem information includes its
status (S: entry from MAINTAINERS) whenever it's not the most common one
(Maintained). However this status information is missing for reviewers
and especially for mailing lists, which may be often the only kind of
e-mail address reported for subsystems that are of Orphan status.

For completeness, include the status information also for reviewers and
lists in the same way as for maintainers. Implementation-wise, factor
out obtaining the subsystem status from get_maintainer_role to a new
function get_subsystem_status.

For the catch-all LKML L: entry defined in "THE REST" section, the
"subsystem" is kept ommitted and thus also its status "Buried alive in
reporters" is not reported.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 scripts/get_maintainer.pl | 61 ++++++++++++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 24 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 82a0032f4d4c7dad876afeb601b5f1957d1a838f..c9373a21da2537181f5c9eb09bb901d1981cb0dc 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -1263,6 +1263,28 @@ sub find_ending_index {
     return $index;
 }
 
+sub get_subsystem_status {
+    my ($index) = @_;
+
+    my $i;
+    my $start = find_starting_index($index);
+    my $end = find_ending_index($index);
+
+    my $status = "unknown";
+    for ($i = $start + 1; $i < $end; $i++) {
+	my $tv = $typevalue[$i];
+	if ($tv =~ m/^([A-Z]):\s*(.*)/) {
+	    my $ptype = $1;
+	    my $pvalue = $2;
+	    if ($ptype eq "S") {
+		$status = $pvalue;
+	    }
+	}
+    }
+
+    return lc($status);
+}
+
 sub get_subsystem_name {
     my ($index) = @_;
 
@@ -1280,44 +1302,31 @@ sub get_subsystem_name {
 sub get_maintainer_role {
     my ($index) = @_;
 
-    my $i;
-    my $start = find_starting_index($index);
-    my $end = find_ending_index($index);
-
-    my $role = "unknown";
+    my $role = "maintainer";
     my $subsystem = get_subsystem_name($index);
-    my $substatus = "";
-
-    for ($i = $start + 1; $i < $end; $i++) {
-	my $tv = $typevalue[$i];
-	if ($tv =~ m/^([A-Z]):\s*(.*)/) {
-	    my $ptype = $1;
-	    my $pvalue = $2;
-	    if ($ptype eq "S") {
-		$role = $pvalue;
-	    }
-	}
-    }
+    my $status = get_subsystem_status($index);
 
-    $role = lc($role);
-    if ($role eq "maintained") {
-	$role = "maintainer";
-    } elsif ($role eq "buried alive in reporters") {
+    if ($status eq "maintained") {
+	$status = "";
+    } elsif ($status eq "buried alive in reporters") {
+	$status = "";
 	$role = "chief penguin";
     } else {
-	$substatus = " [" . $role . "]";
-	$role = "maintainer";
+	$status = " [" . $status . "]";
     }
-    return $role . ":" . $subsystem . $substatus;
+    return $role . ":" . $subsystem . $status;
 }
 
 sub get_list_role {
     my ($index) = @_;
 
     my $subsystem = get_subsystem_name($index);
+    my $status = get_subsystem_status($index);
 
     if ($subsystem eq "THE REST") {
 	$subsystem = "";
+    } elsif ($status ne "maintained") {
+	$subsystem .= " [" . $status . "]";
     }
 
     return $subsystem;
@@ -1382,6 +1391,10 @@ sub add_categories {
 	    } elsif ($ptype eq "R") {
 		if ($email_reviewer) {
 		    my $subsystem = get_subsystem_name($i);
+		    my $status = get_subsystem_status($i);
+		    if ($status ne "maintained") {
+			$subsystem .= " [" . $status . "]";
+		    }
 		    push_email_addresses($pvalue, "reviewer:$subsystem" . $suffix);
 		}
 	    } elsif ($ptype eq "T") {

-- 
2.47.1


      parent reply	other threads:[~2025-01-14  9:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14  8:57 [PATCH 0/2] get_maintainer: report subsystem status separately from maintainer role Vlastimil Babka
2025-01-14  8:57 ` [PATCH 1/2] get_maintainer: decouple subsystem status " Vlastimil Babka
2025-01-14  8:57 ` Vlastimil Babka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250114-b4-get_maintainer-v1-2-ecf40f0d032d@suse.cz \
    --to=vbabka@suse.cz \
    --cc=bryan.odonoghue@linaro.org \
    --cc=joe@perches.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=tytso@mit.edu \
    --cc=workflows@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox