Message ID | 20221013215738.32326-1-palmer@rivosinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp502857wrs; Thu, 13 Oct 2022 15:13:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4RkNCpqQ4OogEByPXH9to1akb26CcV68wBciU6/XZEP/j1cfcuoTYvb0shLZLGW9K/7Ajj X-Received: by 2002:a17:902:b901:b0:184:5b9a:24f0 with SMTP id bf1-20020a170902b90100b001845b9a24f0mr2048639plb.17.1665699234187; Thu, 13 Oct 2022 15:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665699234; cv=none; d=google.com; s=arc-20160816; b=kDNW/t8qUR9BGpZsT7CbLiz/b4xTxpI5etJNIv6qp2c0Jq46wv5pv46HpMoIemt6Mp QNoKcvkUHh3x5a9omzmtgmNJMWY2et3Ze0BWmWQUo4gaorRylZuu12qyjvW6nXre+Aod 2vCKhoPPVJ9fwLJNrz1aNAg0A1DzRs0TfIZaaRdmoYtfPQzkQjROpWd4Y5NtoyUceAYb tRgIH+Bm4/SaghPNmrG9tAeP681T+nUVL4fsPGbMpuiQLrl06uCMqrxgduB+A6xzfEPA zFqkjRAeg6qvsmw/EcKI0F4rh7nnDEYyMDYWLy+foav5wvpv5abVhduxo15c02+9ZVlm nfWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:message-id:date:subject:dkim-signature; bh=7rCkn9jK5l0UbesP3+Ce+8gzCsYUhag1x17HoTBJI/4=; b=VVL0JQo+pqW4iDvrfMXaOj7vG6lRVYaS3XCjAFgOThFKLuvq1YunLI4nIWkxIHzZd+ tb91C9CGLH5nXpIYpdYTNlP6MTkOe1njXNCFUklxdBT6gZgwcY3eJx53rH9JaxwMXQQF mIJpJ1ClusukJjIRAnu/6mDzeoSPl0/Ua5FCO3PqXa3HbRRy2dZBo/9JF0Y13mkelBFB 9Uvv4FivKw7iRXOVwToM4kXOupSqaz5GYu6vFaOImkoXpVCVYWMtzMm+P+xi9AMa6Zog hFoFo640bPsuZykwxe6vaqiLUQAcvB4EOtbQZA4fwvcnjeHORBfMdqCBFZELVFRRB3OI tuoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=Bd5MANJd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a635c18000000b0046af646c669si587682pgb.664.2022.10.13.15.13.06; Thu, 13 Oct 2022 15:13:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=Bd5MANJd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiJMV6D (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Thu, 13 Oct 2022 17:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbiJMV6B (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Oct 2022 17:58:01 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51BEBB1DF1 for <linux-kernel@vger.kernel.org>; Thu, 13 Oct 2022 14:58:00 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id t12-20020a17090a3b4c00b0020b04251529so3061016pjf.5 for <linux-kernel@vger.kernel.org>; Thu, 13 Oct 2022 14:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:from:to:cc:subject:date:message-id:reply-to; bh=7rCkn9jK5l0UbesP3+Ce+8gzCsYUhag1x17HoTBJI/4=; b=Bd5MANJdFPf7AAPWzhjx8DS8Ad1Fihxg8XpuuWgzMF3mM8ig4dYismUPALwegG2Ii9 jR1SkFDzMmgnMPgGGOPFY36c/c1OYknQVPtQbIcC6VRG8sEhbPTdgINWCLxsTMQ5CFCC uO08684sdudbseuckZV95KSkORuPemJCWTsh356bMYGH6oEOrdEIRE0IdIrxtGxDDOoQ kDPk4WkFV3734A6ctSYzJ9Xq3r5PXYOvgLBADqSGyTmpeqjI60cNGIdIlB5X+514toDw f4y4/vr/i9T+m/5wKX4A4dsFXMfkiQCacvVOZCnUP2f+byjb7zbDonNbKEId4xZqYhnj H0Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7rCkn9jK5l0UbesP3+Ce+8gzCsYUhag1x17HoTBJI/4=; b=yi8E+uPss58X6PRIJQ3vpOx8qU3L/Szkl7V0XjtNccmkvCZp7A+tIPPniCNPUiDiKw xISeyeqc440l4uPUl1zJ0XK82s9e/SoIFIfa+vcL4PncRHIYxZ5cnENvH9V90d3ay0L4 0CfBtgT97CxcAE7YrzcdklLt9XoX0PruIJySZn7NpmK+EKGrO84I9LPKHph6FldOnHtb 6ZfxtS+PldoAz75gc75B3WbPvUYNAxQqdpUekd4gZCDVxKSzdthGPQLuq+PK/+Uk/cNw N6Nvb36OGyEGStN7fMgqe0xpxS22k3w6REsM5eg5Cd/BUPe/eGk6tiDhnvny9itqgV+V VI9Q== X-Gm-Message-State: ACrzQf1t6eC+jv8AEwv+ORZJl8Pf0i+suFpMZ/MBPAZl7IOaW7M3daJx t+b9bFtQV7uTsiy0TgLMIX8g5CdQGgOSVzOM X-Received: by 2002:a17:903:2402:b0:184:29:8ac0 with SMTP id e2-20020a170903240200b0018400298ac0mr1999186plo.174.1665698279505; Thu, 13 Oct 2022 14:57:59 -0700 (PDT) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id i6-20020a628706000000b00553b37c7732sm175476pfe.105.2022.10.13.14.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 14:57:59 -0700 (PDT) Subject: [PATCH] get_maintainer: Add the --for-tree argument Date: Thu, 13 Oct 2022 14:57:38 -0700 Message-Id: <20221013215738.32326-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: linux-kernel@vger.kernel.org, Palmer Dabbelt <palmer@rivosinc.com> From: Palmer Dabbelt <palmer@rivosinc.com> To: joe@perches.com X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746612239909624979?= X-GMAIL-MSGID: =?utf-8?q?1746612239909624979?= |
Series |
get_maintainer: Add the --for-tree argument
|
|
Commit Message
Palmer Dabbelt
Oct. 13, 2022, 9:57 p.m. UTC
I recently wanted to look up the maintainers for each tree path via a
script, and I couldn't find a better way to do that than poking
get_maintainer.pl to add a new argument. This lets folks run something
like
$ ./scripts/get_maintainer.pl --for-tree git://github.com/kvm-riscv/linux.git
Anup Patel <anup@brainfault.org> (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv))
kvm@vger.kernel.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv))
kvm-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv))
linux-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv))
to find out who owns a tree.
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
scripts/get_maintainer.pl | 48 +++++++++++++++++++++++++++++++++++++--
1 file changed, 46 insertions(+), 2 deletions(-)
Comments
On Thu, 2022-10-13 at 14:57 -0700, Palmer Dabbelt wrote: > I recently wanted to look up the maintainers for each tree path via a > script, and I couldn't find a better way to do that than poking > get_maintainer.pl to add a new argument. This lets folks run something > like > > $ ./scripts/get_maintainer.pl --for-tree git://github.com/kvm-riscv/linux.git > Anup Patel <anup@brainfault.org> (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) > kvm@vger.kernel.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) > kvm-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) > linux-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) > > to find out who owns a tree. I'm not sure this is useful. It seems far simpler to grep the MAINTAINERS file for the repository. And: $ git grep "^T:" MAINTAINERS | sort | uniq -c | sort -rn | head -10 153 MAINTAINERS:T: git git://linuxtv.org/media_tree.git 70 MAINTAINERS:T: git git://anongit.freedesktop.org/drm/drm-misc 33 MAINTAINERS:T: git git://linuxtv.org/anttip/media_tree.git 9 MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git 6 MAINTAINERS:T: git git://linuxtv.org/mkrufky/tuners.git 6 MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening 6 MAINTAINERS:T: git git://github.com/broadcom/stblinux.git 5 MAINTAINERS:T: git git://git.kernel.org/pub/scm/virt/kvm/kvm.git 5 MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm 5 MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev I think I would not like to see the output for git repositories with 153 matches. (or even 5 matches) For instance: (I've more comments below this too) $ ./scripts/get_maintainer.pl --for-tree=git://linuxtv.org/media_tree.git Hans Verkuil <hverkuil@xs4all.nl> (maintainer:AIMSLAB FM RADIO RECEIVER DRIVER) linux-media@vger.kernel.org (maintainer:AIMSLAB FM RADIO RECEIVER DRIVER) Maxime Ripard <mripard@kernel.org> (maintainer:ALLWINNER A10 CSI DRIVER) Paul Kocialkowski <paul.kocialkowski@bootlin.com> (maintainer:ALLWINNER A31 MIPI CSI-2 BRIDGE DRIVER) Tianshu Qiu <tian.shu.qiu@intel.com> (maintainer:ASAHI KASEI AK7375 LENS VOICE COIL DRIVER) Mauro Carvalho Chehab <mchehab@kernel.org> (maintainer:AZ6007 DVB DRIVER) Fabien Dessenne <fabien.dessenne@foss.st.com> (supporter:BDISP ST MEDIA DRIVER) Joe Tessler <jrt@google.com> (maintainer:CHRONTEL CH7322 CEC DRIVER) Yong Deng <yong.deng@magewell.com> (maintainer:CSI DRIVERS FOR ALLWINNER V3s) Andy Walls <awalls@md.metrocast.net> (maintainer:CX18 VIDEO4LINUX DRIVER) Jernej Skrabec <jernej.skrabec@gmail.com> (maintainer:DEINTERLACE DRIVERS FOR ALLWINNER H3) Hugues Fruchet <hugues.fruchet@foss.st.com> (supporter:DELTA ST MEDIA DRIVER) Sakari Ailus <sakari.ailus@linux.intel.com> (maintainer:DONGWOON DW9714 LENS VOICE COIL DRIVER) Dongchun Zhu <dongchun.zhu@mediatek.com> (maintainer:DONGWOON DW9768 LENS VOICE COIL DRIVER) Alexey Klimov <klimov.linux@gmail.com> (maintainer:DSBR100 USB FM RADIO DRIVER) Michael Krufky <mkrufky@linuxtv.org> (maintainer:DVB_USB_CXUSB MEDIA DRIVER) Charles-Antoine Couret <charles-antoine.couret@nexvision.fr> (maintainer:GS1662 VIDEO SERIALIZER) Frank Zago <frank@zago.net> (maintainer:GSPCA FINEPIX SUBDRIVER) Olivier Lorin <o.lorin@laposte.net> (maintainer:GSPCA GL860 SUBDRIVER) Erik Andren <erik.andren@gmail.com> (maintainer:GSPCA M5602 SUBDRIVER) Brian Johnson <brijohn@gmail.com> (maintainer:GSPCA SN9C20X SUBDRIVER) Leandro Costantino <lcostantino@gmail.com> (maintainer:GSPCA T613 SUBDRIVER) Jean-Christophe Trotin <jean-christophe.trotin@foss.st.com> (supporter:HVA ST MEDIA DRIVER) Shawn Tu <shawnx.tu@intel.com> (maintainer:HYNIX HI556 SENSOR DRIVER) Yong Zhi <yong.zhi@intel.com> (maintainer:INTEL IPU3 CSI-2 CIO2 DRIVER) Bingbu Cao <bingbu.cao@intel.com> (maintainer:INTEL IPU3 CSI-2 CIO2 DRIVER) Dan Scally <djrscally@gmail.com> (maintainer:INTEL IPU3 CSI-2 CIO2 DRIVER) Ramesh Shanmugasundaram <rashanmu@gmail.com> (maintainer:MAX2175 SDR TUNER DRIVER) Laurent Pinchart <laurent.pinchart@ideasonboard.com> (supporter:MEDIA CONTROLLER FRAMEWORK) Philipp Zabel <p.zabel@pengutronix.de> (maintainer:MEDIA DRIVER FOR FREESCALE IMX PXP) Sergey Kozlov <serjk@netup.ru> (supporter:MEDIA DRIVERS FOR ASCOT2E) Abylay Ospan <aospan@netup.ru> (supporter:MEDIA DRIVERS FOR ASCOT2E) Jasmin Jessich <jasmin@anw.at> (maintainer:MEDIA DRIVERS FOR CXD2099AR CI CONTROLLERS) Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> (supporter:MEDIA DRIVERS FOR CXD2880) Steve Longerbeam <slongerbeam@gmail.com> (maintainer:MEDIA DRIVERS FOR FREESCALE IMX) Rui Miguel Silva <rmfrfs@gmail.com> (maintainer:MEDIA DRIVERS FOR FREESCALE IMX7) Dmitry Osipenko <digetx@gmail.com> (maintainer:MEDIA DRIVERS FOR NVIDIA TEGRA - VDE) linux-tegra@vger.kernel.org (maintainer:MEDIA DRIVERS FOR NVIDIA TEGRA - VDE) Jacopo Mondi <jacopo@jmondi.org> (supporter:MEDIA DRIVERS FOR RENESAS - CEU) linux-renesas-soc@vger.kernel.org (supporter:MEDIA DRIVERS FOR RENESAS - CEU) Fabrizio Castro <fabrizio.castro.jz@renesas.com> (supporter:MEDIA DRIVERS FOR RENESAS - DRIF) Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> (supporter:MEDIA DRIVERS FOR RENESAS - FDP1) "Niklas Söderlund" <niklas.soderlund@ragnatech.se> (supporter:MEDIA DRIVERS FOR RENESAS - VIN) Neil Armstrong <neil.armstrong@linaro.org> (supporter:MESON AO CEC DRIVER FOR AMLOGIC SOCS) linux-amlogic@lists.infradead.org (supporter:MESON AO CEC DRIVER FOR AMLOGIC SOCS) Jimmy Su <jimmy.su@intel.com> (maintainer:OMNIVISION OV08D10 SENSOR DRIVER) Arec Kao <arec.kao@intel.com> (maintainer:OMNIVISION OV13B10 SENSOR DRIVER) Shunqian Zheng <zhengsq@rock-chips.com> (maintainer:OMNIVISION OV2685 SENSOR DRIVER) Dave Stevenson <dave.stevenson@raspberrypi.com> (maintainer:OMNIVISION OV5647 SENSOR DRIVER) Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> (maintainer:OMNIVISION OV5670 SENSOR DRIVER) Wenyou Yang <wenyou.yang@microchip.com> (maintainer:OMNIVISION OV7740 SENSOR DRIVER) "Paul J. Murphy" <paul.j.murphy@intel.com> (maintainer:OMNIVISION OV9282 SENSOR DRIVER) Daniele Alessandrelli <daniele.alessandrelli@intel.com> (maintainer:OMNIVISION OV9282 SENSOR DRIVER) Mike Isely <isely@pobox.com> (maintainer:PVRUSB2 VIDEO4LINUX DRIVER) pvrusb2@isely.net (maintainer:PVRUSB2 VIDEO4LINUX DRIVER) Stanimir Varbanov <stanimir.varbanov@linaro.org> (maintainer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) linux-arm-msm@vger.kernel.org (maintainer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) Sean Young <sean@mess.org> (maintainer:RC-CORE / LIRC FRAMEWORK) Eduardo Valentin <edubezval@gmail.com> (odd fixer:SI4713 FM RADIO TRANSMITTER I2C DRIVER) Ricardo Ribalda <ribalda@kernel.org> (maintainer:SONY IMX214 SENSOR DRIVER) Leon Luo <leonl@leopardimaging.com> (maintainer:SONY IMX274 SENSOR DRIVER) Manivannan Sadhasivam <mani@kernel.org> (maintainer:SONY IMX290 SENSOR DRIVER) Benjamin Mugnier <benjamin.mugnier@foss.st.com> (maintainer:ST MIPID02 CSI-2 TO PARALLEL BRIDGE DRIVER) Sylvain Petinot <sylvain.petinot@foss.st.com> (maintainer:ST MIPID02 CSI-2 TO PARALLEL BRIDGE DRIVER) Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> (maintainer:STK1160 USB VIDEO CAPTURE DRIVER) Olli Salonen <olli.salonen@iki.fi> (maintainer:TDA18250 MEDIA DRIVER) Antoine Jacquet <royale@zerezo.com> (maintainer:USB ZR364XX DRIVER) linux-usb@vger.kernel.org (maintainer:USB ZR364XX DRIVER) Shuah Khan <skhan@linuxfoundation.org> (maintainer:VIMC VIRTUAL MEDIA CONTROLLER DRIVER) "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> (maintainer:VIDTV VIRTUAL DIGITAL TV DRIVER) Hyun Kwon <hyun.kwon@xilinx.com> (supporter:XILINX VIDEO IP CORES) And I don't know how this is an improvement as the --for-tree argument seems _very_ likely to be typoed. > diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl [] > @@ -23,6 +23,7 @@ use File::Spec::Functions; > > my $cur_path = fastgetcwd() . '/'; > my $lk_path = "./"; > +my $for_tree = undef; > my $email = 1; > my $email_usename = 1; > my $email_maintainer = 1; > @@ -239,6 +240,7 @@ if ($#ARGV > 0) { > > if (!GetOptions( > 'email!' => \$email, > + 'for-tree=s' => \$for_tree, > 'git!' => \$email_git, > 'git-all-signature-types!' => \$email_git_all_signature_types, > 'git-blame!' => \$email_git_blame, > @@ -300,7 +302,7 @@ if (defined $self_test) { > exit 0; > } > > -if (-t STDIN && !@ARGV) { > +if (-t STDIN && !@ARGV && !$for_tree) { > # We're talking to a terminal, but have no command line arguments. > die "$P: missing patchfile or -f file - use --help if necessary\n"; > } > @@ -527,7 +529,7 @@ sub read_mailmap { > > ## use the filenames on the command line or find the filenames in the patchfiles > > -if (!@ARGV) { > +if (!@ARGV && !$for_tree) { > push(@ARGV, "&STDIN"); > } > > @@ -951,6 +953,47 @@ sub get_maintainers { > } > } > > + if ($for_tree) { > + my $tvi = find_first_section(); > + while ($tvi < @typevalue) { > + my $start = find_starting_index($tvi); > + my $end = find_ending_index($tvi); > + $tvi = $end + 1; > + > + my $i; > + my $tree_match = 0; > + for ($i = $start; $i < $end; $i++) { > + my $line = $typevalue[$i]; > + if ($line =~ m/^([A-Z]):(.*)/) { > + my $type = $1; > + my $value = $2; > + > + if ($type eq 'T') { > + if ($for_tree eq $value || "git $for_tree" eq $value) { > + $tree_match = 1 > + } > + } > + } > + } > + > + if ($tree_match) { > + for ($i = $start; $i < $end; $i++) { > + my $line = $typevalue[$i]; > + if ($line =~ m/^([A-Z]):(.*)/) { > + my $type = $1; > + my $value = $2; > + > + if ($type eq 'M' || $type eq 'L') { And what about reviewers? 'R' ? > + my $role = get_maintainer_role($i); Also this improperly marks mailing lists as "maintainer:<SECTION>" rather than "mailing list:<SECTION>" as it uses the S: value for the section rather than the actual role of the person. > + push_email_address($value, $role) > + } > + } > + } > + } > + } > + } > + > + > foreach my $email (@email_to, @list_to) { > $email->[0] = deduplicate_email($email->[0]); > } > @@ -1074,6 +1117,7 @@ Output type options: > --multiline => print 1 entry per line > > Other options: > + --for-tree => Get maintainers for the given tree > --pattern-depth => Number of pattern directory traversals (default: 0 (all)) > --keywords => scan patch for keywords (default: $keywords) > --sections => print all of the subsystem sections with pattern matches
On Thu, 13 Oct 2022 17:39:53 PDT (-0700), joe@perches.com wrote: > On Thu, 2022-10-13 at 14:57 -0700, Palmer Dabbelt wrote: >> I recently wanted to look up the maintainers for each tree path via a >> script, and I couldn't find a better way to do that than poking >> get_maintainer.pl to add a new argument. This lets folks run something >> like >> >> $ ./scripts/get_maintainer.pl --for-tree git://github.com/kvm-riscv/linux.git >> Anup Patel <anup@brainfault.org> (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) >> kvm@vger.kernel.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) >> kvm-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) >> linux-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) >> >> to find out who owns a tree. > > I'm not sure this is useful. Seems reasonable, I'm also not sure anyone would want to do this again. I had a pretty specific use case for this, where I wanted to poke folks who still had git://github.com URLs in MAINTAINERS to move them to https://github.com URLs. I'm not sure anyone would every want to do that sort of thing again, so no big deal on my end if this is just a NAK. > It seems far simpler to grep the MAINTAINERS file for the repository. That's what I tried first, but I didn't have any luck getting reliable results. It's fine if you want to handle one at a time, but not if you're trying to script something -- though maybe making it easy to script this sort if thing is a bad idea, as it's somewhat likely to blast too many people? > And: > > $ git grep "^T:" MAINTAINERS | sort | uniq -c | sort -rn | head -10 > 153 MAINTAINERS:T: git git://linuxtv.org/media_tree.git > 70 MAINTAINERS:T: git git://anongit.freedesktop.org/drm/drm-misc > 33 MAINTAINERS:T: git git://linuxtv.org/anttip/media_tree.git > 9 MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git > 6 MAINTAINERS:T: git git://linuxtv.org/mkrufky/tuners.git > 6 MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening > 6 MAINTAINERS:T: git git://github.com/broadcom/stblinux.git > 5 MAINTAINERS:T: git git://git.kernel.org/pub/scm/virt/kvm/kvm.git > 5 MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm > 5 MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev > > I think I would not like to see the output for git repositories > with 153 matches. (or even 5 matches) The stblinux repo's URL is dead, I sent mail to all 5 of them. Maybe that's overkill, but it seemed reasonable to me at the time... > For instance: (I've more comments below this too) > > $ ./scripts/get_maintainer.pl --for-tree=git://linuxtv.org/media_tree.git > Hans Verkuil <hverkuil@xs4all.nl> (maintainer:AIMSLAB FM RADIO RECEIVER DRIVER) > linux-media@vger.kernel.org (maintainer:AIMSLAB FM RADIO RECEIVER DRIVER) > Maxime Ripard <mripard@kernel.org> (maintainer:ALLWINNER A10 CSI DRIVER) > Paul Kocialkowski <paul.kocialkowski@bootlin.com> (maintainer:ALLWINNER A31 MIPI CSI-2 BRIDGE DRIVER) > Tianshu Qiu <tian.shu.qiu@intel.com> (maintainer:ASAHI KASEI AK7375 LENS VOICE COIL DRIVER) > Mauro Carvalho Chehab <mchehab@kernel.org> (maintainer:AZ6007 DVB DRIVER) > Fabien Dessenne <fabien.dessenne@foss.st.com> (supporter:BDISP ST MEDIA DRIVER) > Joe Tessler <jrt@google.com> (maintainer:CHRONTEL CH7322 CEC DRIVER) > Yong Deng <yong.deng@magewell.com> (maintainer:CSI DRIVERS FOR ALLWINNER V3s) > Andy Walls <awalls@md.metrocast.net> (maintainer:CX18 VIDEO4LINUX DRIVER) > Jernej Skrabec <jernej.skrabec@gmail.com> (maintainer:DEINTERLACE DRIVERS FOR ALLWINNER H3) > Hugues Fruchet <hugues.fruchet@foss.st.com> (supporter:DELTA ST MEDIA DRIVER) > Sakari Ailus <sakari.ailus@linux.intel.com> (maintainer:DONGWOON DW9714 LENS VOICE COIL DRIVER) > Dongchun Zhu <dongchun.zhu@mediatek.com> (maintainer:DONGWOON DW9768 LENS VOICE COIL DRIVER) > Alexey Klimov <klimov.linux@gmail.com> (maintainer:DSBR100 USB FM RADIO DRIVER) > Michael Krufky <mkrufky@linuxtv.org> (maintainer:DVB_USB_CXUSB MEDIA DRIVER) > Charles-Antoine Couret <charles-antoine.couret@nexvision.fr> (maintainer:GS1662 VIDEO SERIALIZER) > Frank Zago <frank@zago.net> (maintainer:GSPCA FINEPIX SUBDRIVER) > Olivier Lorin <o.lorin@laposte.net> (maintainer:GSPCA GL860 SUBDRIVER) > Erik Andren <erik.andren@gmail.com> (maintainer:GSPCA M5602 SUBDRIVER) > Brian Johnson <brijohn@gmail.com> (maintainer:GSPCA SN9C20X SUBDRIVER) > Leandro Costantino <lcostantino@gmail.com> (maintainer:GSPCA T613 SUBDRIVER) > Jean-Christophe Trotin <jean-christophe.trotin@foss.st.com> (supporter:HVA ST MEDIA DRIVER) > Shawn Tu <shawnx.tu@intel.com> (maintainer:HYNIX HI556 SENSOR DRIVER) > Yong Zhi <yong.zhi@intel.com> (maintainer:INTEL IPU3 CSI-2 CIO2 DRIVER) > Bingbu Cao <bingbu.cao@intel.com> (maintainer:INTEL IPU3 CSI-2 CIO2 DRIVER) > Dan Scally <djrscally@gmail.com> (maintainer:INTEL IPU3 CSI-2 CIO2 DRIVER) > Ramesh Shanmugasundaram <rashanmu@gmail.com> (maintainer:MAX2175 SDR TUNER DRIVER) > Laurent Pinchart <laurent.pinchart@ideasonboard.com> (supporter:MEDIA CONTROLLER FRAMEWORK) > Philipp Zabel <p.zabel@pengutronix.de> (maintainer:MEDIA DRIVER FOR FREESCALE IMX PXP) > Sergey Kozlov <serjk@netup.ru> (supporter:MEDIA DRIVERS FOR ASCOT2E) > Abylay Ospan <aospan@netup.ru> (supporter:MEDIA DRIVERS FOR ASCOT2E) > Jasmin Jessich <jasmin@anw.at> (maintainer:MEDIA DRIVERS FOR CXD2099AR CI CONTROLLERS) > Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> (supporter:MEDIA DRIVERS FOR CXD2880) > Steve Longerbeam <slongerbeam@gmail.com> (maintainer:MEDIA DRIVERS FOR FREESCALE IMX) > Rui Miguel Silva <rmfrfs@gmail.com> (maintainer:MEDIA DRIVERS FOR FREESCALE IMX7) > Dmitry Osipenko <digetx@gmail.com> (maintainer:MEDIA DRIVERS FOR NVIDIA TEGRA - VDE) > linux-tegra@vger.kernel.org (maintainer:MEDIA DRIVERS FOR NVIDIA TEGRA - VDE) > Jacopo Mondi <jacopo@jmondi.org> (supporter:MEDIA DRIVERS FOR RENESAS - CEU) > linux-renesas-soc@vger.kernel.org (supporter:MEDIA DRIVERS FOR RENESAS - CEU) > Fabrizio Castro <fabrizio.castro.jz@renesas.com> (supporter:MEDIA DRIVERS FOR RENESAS - DRIF) > Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> (supporter:MEDIA DRIVERS FOR RENESAS - FDP1) > "Niklas Söderlund" <niklas.soderlund@ragnatech.se> (supporter:MEDIA DRIVERS FOR RENESAS - VIN) > Neil Armstrong <neil.armstrong@linaro.org> (supporter:MESON AO CEC DRIVER FOR AMLOGIC SOCS) > linux-amlogic@lists.infradead.org (supporter:MESON AO CEC DRIVER FOR AMLOGIC SOCS) > Jimmy Su <jimmy.su@intel.com> (maintainer:OMNIVISION OV08D10 SENSOR DRIVER) > Arec Kao <arec.kao@intel.com> (maintainer:OMNIVISION OV13B10 SENSOR DRIVER) > Shunqian Zheng <zhengsq@rock-chips.com> (maintainer:OMNIVISION OV2685 SENSOR DRIVER) > Dave Stevenson <dave.stevenson@raspberrypi.com> (maintainer:OMNIVISION OV5647 SENSOR DRIVER) > Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com> (maintainer:OMNIVISION OV5670 SENSOR DRIVER) > Wenyou Yang <wenyou.yang@microchip.com> (maintainer:OMNIVISION OV7740 SENSOR DRIVER) > "Paul J. Murphy" <paul.j.murphy@intel.com> (maintainer:OMNIVISION OV9282 SENSOR DRIVER) > Daniele Alessandrelli <daniele.alessandrelli@intel.com> (maintainer:OMNIVISION OV9282 SENSOR DRIVER) > Mike Isely <isely@pobox.com> (maintainer:PVRUSB2 VIDEO4LINUX DRIVER) > pvrusb2@isely.net (maintainer:PVRUSB2 VIDEO4LINUX DRIVER) > Stanimir Varbanov <stanimir.varbanov@linaro.org> (maintainer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) > linux-arm-msm@vger.kernel.org (maintainer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) > Sean Young <sean@mess.org> (maintainer:RC-CORE / LIRC FRAMEWORK) > Eduardo Valentin <edubezval@gmail.com> (odd fixer:SI4713 FM RADIO TRANSMITTER I2C DRIVER) > Ricardo Ribalda <ribalda@kernel.org> (maintainer:SONY IMX214 SENSOR DRIVER) > Leon Luo <leonl@leopardimaging.com> (maintainer:SONY IMX274 SENSOR DRIVER) > Manivannan Sadhasivam <mani@kernel.org> (maintainer:SONY IMX290 SENSOR DRIVER) > Benjamin Mugnier <benjamin.mugnier@foss.st.com> (maintainer:ST MIPID02 CSI-2 TO PARALLEL BRIDGE DRIVER) > Sylvain Petinot <sylvain.petinot@foss.st.com> (maintainer:ST MIPID02 CSI-2 TO PARALLEL BRIDGE DRIVER) > Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> (maintainer:STK1160 USB VIDEO CAPTURE DRIVER) > Olli Salonen <olli.salonen@iki.fi> (maintainer:TDA18250 MEDIA DRIVER) > Antoine Jacquet <royale@zerezo.com> (maintainer:USB ZR364XX DRIVER) > linux-usb@vger.kernel.org (maintainer:USB ZR364XX DRIVER) > Shuah Khan <skhan@linuxfoundation.org> (maintainer:VIMC VIRTUAL MEDIA CONTROLLER DRIVER) > "Daniel W. S. Almeida" <dwlsalmeida@gmail.com> (maintainer:VIDTV VIRTUAL DIGITAL TV DRIVER) > Hyun Kwon <hyun.kwon@xilinx.com> (supporter:XILINX VIDEO IP CORES) That certainly seems pretty worthless as a To list, but I guess in that case user get what they asked for? For something like "your repo's URL is dead" it seems generally reasonable to just poke everyone involved, though blasting 153 people would still be a bad idea. I always assume that get_maintainers.pl might produce too many people and take a look before sending a big email, but if this makes it too easy to just send something wacky then I'm fine just tossing it. Either way, I certainly hope to never have to use this again so no big deal on my end ;) > And I don't know how this is an improvement as the --for-tree argument > seems _very_ likely to be typoed. > >> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl > [] >> @@ -23,6 +23,7 @@ use File::Spec::Functions; >> >> my $cur_path = fastgetcwd() . '/'; >> my $lk_path = "./"; >> +my $for_tree = undef; >> my $email = 1; >> my $email_usename = 1; >> my $email_maintainer = 1; >> @@ -239,6 +240,7 @@ if ($#ARGV > 0) { >> >> if (!GetOptions( >> 'email!' => \$email, >> + 'for-tree=s' => \$for_tree, >> 'git!' => \$email_git, >> 'git-all-signature-types!' => \$email_git_all_signature_types, >> 'git-blame!' => \$email_git_blame, >> @@ -300,7 +302,7 @@ if (defined $self_test) { >> exit 0; >> } >> >> -if (-t STDIN && !@ARGV) { >> +if (-t STDIN && !@ARGV && !$for_tree) { >> # We're talking to a terminal, but have no command line arguments. >> die "$P: missing patchfile or -f file - use --help if necessary\n"; >> } >> @@ -527,7 +529,7 @@ sub read_mailmap { >> >> ## use the filenames on the command line or find the filenames in the patchfiles >> >> -if (!@ARGV) { >> +if (!@ARGV && !$for_tree) { >> push(@ARGV, "&STDIN"); >> } >> >> @@ -951,6 +953,47 @@ sub get_maintainers { >> } >> } >> >> + if ($for_tree) { >> + my $tvi = find_first_section(); >> + while ($tvi < @typevalue) { >> + my $start = find_starting_index($tvi); >> + my $end = find_ending_index($tvi); >> + $tvi = $end + 1; >> + >> + my $i; >> + my $tree_match = 0; >> + for ($i = $start; $i < $end; $i++) { >> + my $line = $typevalue[$i]; >> + if ($line =~ m/^([A-Z]):(.*)/) { >> + my $type = $1; >> + my $value = $2; >> + >> + if ($type eq 'T') { >> + if ($for_tree eq $value || "git $for_tree" eq $value) { >> + $tree_match = 1 >> + } >> + } >> + } >> + } >> + >> + if ($tree_match) { >> + for ($i = $start; $i < $end; $i++) { >> + my $line = $typevalue[$i]; >> + if ($line =~ m/^([A-Z]):(.*)/) { >> + my $type = $1; >> + my $value = $2; >> + >> + if ($type eq 'M' || $type eq 'L') { > > And what about reviewers? 'R' ? > >> + my $role = get_maintainer_role($i); > > Also this improperly marks mailing lists as "maintainer:<SECTION>" > rather than "mailing list:<SECTION>" as it uses the S: value for > the section rather than the actual role of the person. OK, sorry about those. Happy to fix them, but I know almost nothing about get_maintainers.pl so it'd take a bit. Generally sound like you don't want this one so I'm going to punt on fixing these for now, I don't care all that much about having this merged. LMK if you want a v2, though. > >> + push_email_address($value, $role) >> + } >> + } >> + } >> + } >> + } >> + } >> + >> + >> foreach my $email (@email_to, @list_to) { >> $email->[0] = deduplicate_email($email->[0]); >> } >> @@ -1074,6 +1117,7 @@ Output type options: >> --multiline => print 1 entry per line >> >> Other options: >> + --for-tree => Get maintainers for the given tree >> --pattern-depth => Number of pattern directory traversals (default: 0 (all)) >> --keywords => scan patch for keywords (default: $keywords) >> --sections => print all of the subsystem sections with pattern matches
On Thu, 2022-10-13 at 19:56 -0700, Palmer Dabbelt wrote: > On Thu, 13 Oct 2022 17:39:53 PDT (-0700), joe@perches.com wrote: > > On Thu, 2022-10-13 at 14:57 -0700, Palmer Dabbelt wrote: > > > I recently wanted to look up the maintainers for each tree path via a > > > script, and I couldn't find a better way to do that than poking > > > get_maintainer.pl to add a new argument. This lets folks run something > > > like > > > > > > $ ./scripts/get_maintainer.pl --for-tree git://github.com/kvm-riscv/linux.git > > > Anup Patel <anup@brainfault.org> (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) > > > kvm@vger.kernel.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) > > > kvm-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) > > > linux-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) > > > > > > to find out who owns a tree. > > > > I'm not sure this is useful. [] > Generally sound like you > don't want this one so I'm going to punt on fixing these for now, I > don't care all that much about having this merged. > > LMK if you want a v2, though. I think it's not necessary. Thanks, Joe
On Thu, 13 Oct 2022 20:48:10 PDT (-0700), joe@perches.com wrote: > On Thu, 2022-10-13 at 19:56 -0700, Palmer Dabbelt wrote: >> On Thu, 13 Oct 2022 17:39:53 PDT (-0700), joe@perches.com wrote: >> > On Thu, 2022-10-13 at 14:57 -0700, Palmer Dabbelt wrote: >> > > I recently wanted to look up the maintainers for each tree path via a >> > > script, and I couldn't find a better way to do that than poking >> > > get_maintainer.pl to add a new argument. This lets folks run something >> > > like >> > > >> > > $ ./scripts/get_maintainer.pl --for-tree git://github.com/kvm-riscv/linux.git >> > > Anup Patel <anup@brainfault.org> (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) >> > > kvm@vger.kernel.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) >> > > kvm-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) >> > > linux-riscv@lists.infradead.org (maintainer:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)) >> > > >> > > to find out who owns a tree. >> > >> > I'm not sure this is useful. > [] >> Generally sound like you >> don't want this one so I'm going to punt on fixing these for now, I >> don't care all that much about having this merged. >> >> LMK if you want a v2, though. > > I think it's not necessary. Works for me.
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index ab123b498fd9..70abefadd295 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -23,6 +23,7 @@ use File::Spec::Functions; my $cur_path = fastgetcwd() . '/'; my $lk_path = "./"; +my $for_tree = undef; my $email = 1; my $email_usename = 1; my $email_maintainer = 1; @@ -239,6 +240,7 @@ if ($#ARGV > 0) { if (!GetOptions( 'email!' => \$email, + 'for-tree=s' => \$for_tree, 'git!' => \$email_git, 'git-all-signature-types!' => \$email_git_all_signature_types, 'git-blame!' => \$email_git_blame, @@ -300,7 +302,7 @@ if (defined $self_test) { exit 0; } -if (-t STDIN && !@ARGV) { +if (-t STDIN && !@ARGV && !$for_tree) { # We're talking to a terminal, but have no command line arguments. die "$P: missing patchfile or -f file - use --help if necessary\n"; } @@ -527,7 +529,7 @@ sub read_mailmap { ## use the filenames on the command line or find the filenames in the patchfiles -if (!@ARGV) { +if (!@ARGV && !$for_tree) { push(@ARGV, "&STDIN"); } @@ -951,6 +953,47 @@ sub get_maintainers { } } + if ($for_tree) { + my $tvi = find_first_section(); + while ($tvi < @typevalue) { + my $start = find_starting_index($tvi); + my $end = find_ending_index($tvi); + $tvi = $end + 1; + + my $i; + my $tree_match = 0; + for ($i = $start; $i < $end; $i++) { + my $line = $typevalue[$i]; + if ($line =~ m/^([A-Z]):(.*)/) { + my $type = $1; + my $value = $2; + + if ($type eq 'T') { + if ($for_tree eq $value || "git $for_tree" eq $value) { + $tree_match = 1 + } + } + } + } + + if ($tree_match) { + for ($i = $start; $i < $end; $i++) { + my $line = $typevalue[$i]; + if ($line =~ m/^([A-Z]):(.*)/) { + my $type = $1; + my $value = $2; + + if ($type eq 'M' || $type eq 'L') { + my $role = get_maintainer_role($i); + push_email_address($value, $role) + } + } + } + } + } + } + + foreach my $email (@email_to, @list_to) { $email->[0] = deduplicate_email($email->[0]); } @@ -1074,6 +1117,7 @@ Output type options: --multiline => print 1 entry per line Other options: + --for-tree => Get maintainers for the given tree --pattern-depth => Number of pattern directory traversals (default: 0 (all)) --keywords => scan patch for keywords (default: $keywords) --sections => print all of the subsystem sections with pattern matches