Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp533369rdb; Thu, 5 Oct 2023 13:12:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEuldBMLX6/40e70WJC3yK5g1ctAeZwY+RNlKWH7mDCm0KXxehvzEz3wHnHP6X2HnlzFZFR X-Received: by 2002:a05:6358:7246:b0:14f:9904:a17f with SMTP id i6-20020a056358724600b0014f9904a17fmr4832061rwa.15.1696536732029; Thu, 05 Oct 2023 13:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696536731; cv=none; d=google.com; s=arc-20160816; b=ofsD79YUNs8OoUo3i+OAQAZhrQcf760NeuqrA0Trr6aX/+2IhtP0ZXcSsPsnBgGQX1 SKDNSXk8MraZxlpgxZueCAgn5gg1cro7Ptw32DNS/t6gRvlMRB337zQXP1gGMFDBOJHX St28g7Ri5NCG19/0sdcK2IX2VgGr5NxJxrbPY6hco45kv4BrIr6KgN+nFD1pG0DoduEs U2F04bjGlz4rX3kWO28/dKE9i+FLIgbV3C/693mbmP89QmKRVA4YAF2D1ALlT9TLrtrZ kGibagEX0S9T0yhOX+wdrruQiLVMhUdlMQuMlL886WRd7XGcbaErIdGNUEgVJWNxn7I4 Upzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=RJenS8e96CYmPYx44gSsuYhGimZlKWFUjESpGAE1Lho=; fh=hN5ApTOjbFS4WdbDTrk9wDtiax0V3dBkum3z5kaqF1A=; b=n2xC/i7VvdcRX1TD1vrGrQzsaxnI+8a6DFxOIQGNQZ8zY8qWlI86l1QxwUgxvkZNwT YbdJRhFK6wuXdhXlvWFyGZWRsjfcavIO9pGvb7UcdOOrUpxCmpMVxQDSuT03wivJ62nb GfLhon7BgS0HSk5OAUa1zM2QpLAe9e5blzBsXH5hcBf7L4LA8Zg8yI84NCAFg5jnCOzl k2v3+atTccPmHNO7EzGdH/XbDscmUM2dP1NBkCLt2dMJAe3jnBN9Jt4RXGqziRPhjVDV OE2jNbNqqI5RAnF7f9525Qbxg9c3T6627drl8yjPA4KbQvkaVZJLvnGdkUk3UlCH+lCi ZiUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=F6kOv78H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id by30-20020a056a02059e00b0058572c8d5d5si2320806pgb.233.2023.10.05.13.12.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 13:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=F6kOv78H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 31FE0819E177; Thu, 5 Oct 2023 13:12:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbjJEUMA (ORCPT + 99 others); Thu, 5 Oct 2023 16:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjJEUL6 (ORCPT ); Thu, 5 Oct 2023 16:11:58 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90D5CDB for ; Thu, 5 Oct 2023 13:11:55 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-53406799540so2534739a12.1 for ; Thu, 05 Oct 2023 13:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696536714; x=1697141514; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RJenS8e96CYmPYx44gSsuYhGimZlKWFUjESpGAE1Lho=; b=F6kOv78Hn8GGopeoRc4Axbl4jWRhmCHIywEAClrsW3VwV1ouwsb8kTpCd3i8niwAnC 4CKSSZ8wZ640wyCz33C9/LOu3nQbwPkvuZ3lT5FNIv3aWZjiLw3tNlfbuwg3Ubl5kG9r De0wUcvCbfmFnp6kS6+IHYfO97+48PQ5LlJuWDF82v2kI/pfh9zA2r4fzUPWxbJSiDAy lMvny8p/Bk/tMHF0kyKhLIzK0AeZZMQ0s9xp9so3QwMfn3mho0IgBI+ej22tUJ389G0T dhUUiA/U4x0ioBRCZ2OfkixqmbTfP4iBJ2guUICJQd6OS6Wx57QWl4pJI57uklwx9Pdm O/EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696536714; x=1697141514; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RJenS8e96CYmPYx44gSsuYhGimZlKWFUjESpGAE1Lho=; b=EPWjRSdRi/ocAXWIm8ifKopqg+oVvgGAiTAJFeloSjoYH9P5fUZ8ImNrikema4+FAn 4aOey0KDM5nIVK4xuqNL6NhJ5hpxuECANR1b6/JIcGnBbJUYIicH9IfIHELplxr/mAKV foPLEn3efEtCg/M3kJP7IGhQxZ4PBNng/FpHl/F5W8a+zNQahQVxmjiYf4Y7NyjoZYYL KYZYQm1gVWAQCRnYRWyGdWeWQwFrmErzvuQJ0ocLQZRj5eUNJ6y6+LtFv/qT4d5bWLmX 5GOV0W8gpluAmG8V5sT9rpMxE/qxbE5bVit0DKQTb9xpqGYsf2WKk6ndBZR8ADbEPgs0 eNog== X-Gm-Message-State: AOJu0YwCeCH6K1Aqn7k7px2nU8NxbMDMB1qRSt69YJ+HPi1I3iEebuNH wL2Trt/io/bm27iHBjEJWwB7kMpxmkqAPfOBTr6l5C51t9TfJqYNDfEElQ== X-Received: by 2002:aa7:c409:0:b0:530:d6c5:7e79 with SMTP id j9-20020aa7c409000000b00530d6c57e79mr5363224edq.32.1696536713873; Thu, 05 Oct 2023 13:11:53 -0700 (PDT) MIME-Version: 1.0 References: <20231005-get_maintainer_change_k-v2-1-5f7febcfedb3@google.com> In-Reply-To: <20231005-get_maintainer_change_k-v2-1-5f7febcfedb3@google.com> From: Justin Stitt Date: Thu, 5 Oct 2023 13:11:42 -0700 Message-ID: Subject: Re: [PATCH v2] get_maintainer: add --keywords-in-file To: Joe Perches Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 13:12:09 -0700 (PDT) disregard! Joe's spinning up a patch -- coming soon. [1] On Thu, Oct 5, 2023 at 1:09=E2=80=AFPM Justin Stitt wrote: > > There were some recent attempts [1] [2] to make the K: field less noisy > and its behavior more obvious. Ultimately, a shift in the default > behavior and an associated command line flag is the best choice. > > Currently, K: will match keywords found in both patches and files. > Matching content from entire files is (while documented) not obvious > behavior and is usually not wanted by maintainers. This patch opts to > only allow patch content to be matched against unless --keywords-in-file > is provided. > > Link: https://lore.kernel.org/all/20230928-get_maintainer_add_d-v2-0-8acb= 3f394571@google.com/ [1] > Link: https://lore.kernel.org/all/3dca40b677dd2fef979a5a581a2db91df2c2180= 1.camel@perches.com/ [2] > Authored-by: Joe Perches > Signed-off-by: Justin Stitt > --- > Changes in v2: > - Use Joe's patch and ditch this one > - Link to v1: https://lore.kernel.org/r/20231004-get_maintainer_change_k-= v1-1-ac7ced18306a@google.com > --- > Note: I've opted to make this a v2 instead of a whole new patch since > it's related and the patch is authored in v1 by Joe. It will simply > replace the old patch in its entirety. > --- > scripts/get_maintainer.pl | 38 ++++++++++++++++++++------------------ > 1 file changed, 20 insertions(+), 18 deletions(-) > > diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl > index ab123b498fd9..befae75e61ab 100755 > --- a/scripts/get_maintainer.pl > +++ b/scripts/get_maintainer.pl > @@ -57,6 +57,7 @@ my $subsystem =3D 0; > my $status =3D 0; > my $letters =3D ""; > my $keywords =3D 1; > +my $keywords_in_file =3D 0; > my $sections =3D 0; > my $email_file_emails =3D 0; > my $from_filename =3D 0; > @@ -272,6 +273,7 @@ if (!GetOptions( > 'letters=3Ds' =3D> \$letters, > 'pattern-depth=3Di' =3D> \$pattern_depth, > 'k|keywords!' =3D> \$keywords, > + 'kf|keywords-in-file!' =3D> \$keywords_in_file, > 'sections!' =3D> \$sections, > 'fe|file-emails!' =3D> \$email_file_emails, > 'f|file' =3D> \$from_filename, > @@ -318,6 +320,7 @@ if ($sections || $letters ne "") { > $subsystem =3D 0; > $web =3D 0; > $keywords =3D 0; > + $keywords_in_file =3D 0; > $interactive =3D 0; > } else { > my $selections =3D $email + $scm + $status + $subsystem + $web; > @@ -548,16 +551,14 @@ foreach my $file (@ARGV) { > $file =3D~ s/^\Q${cur_path}\E//; #strip any absolute path > $file =3D~ s/^\Q${lk_path}\E//; #or the path to the lk tree > push(@files, $file); > - if ($file ne "MAINTAINERS" && -f $file && $keywords) { > + if ($file ne "MAINTAINERS" && -f $file && $keywords && $keywords_= in_file) { > open(my $f, '<', $file) > or die "$P: Can't open $file: $!\n"; > my $text =3D do { local($/) ; <$f> }; > close($f); > - if ($keywords) { > - foreach my $line (keys %keyword_hash) { > - if ($text =3D~ m/$keyword_hash{$line}/x) { > - push(@keyword_tvi, $line); > - } > + foreach my $line (keys %keyword_hash) { > + if ($text =3D~ m/$keyword_hash{$line}/x) { > + push(@keyword_tvi, $line); > } > } > } > @@ -919,7 +920,7 @@ sub get_maintainers { > } > > foreach my $line (sort {$hash{$b} <=3D> $hash{$a}} keys %hash) { > - add_categories($line); > + add_categories($line, ""); > if ($sections) { > my $i; > my $start =3D find_starting_index($line); > @@ -947,7 +948,7 @@ sub get_maintainers { > if ($keywords) { > @keyword_tvi =3D sort_and_uniq(@keyword_tvi); > foreach my $line (@keyword_tvi) { > - add_categories($line); > + add_categories($line, ":Keyword"); > } > } > > @@ -1076,6 +1077,7 @@ Output type options: > Other options: > --pattern-depth =3D> Number of pattern directory traversals (default: = 0 (all)) > --keywords =3D> scan patch for keywords (default: $keywords) > + --keywords-in-file =3D> scan file for keywords (default: $keywords_in_= file) > --sections =3D> print all of the subsystem sections with pattern match= es > --letters =3D> print all matching 'letter' types from all matching sec= tions > --mailmap =3D> use .mailmap file (default: $email_use_mailmap) > @@ -1086,7 +1088,7 @@ Other options: > > Default options: > [--email --tree --nogit --git-fallback --m --r --n --l --multiline > - --pattern-depth=3D0 --remove-duplicates --rolestats] > + --pattern-depth=3D0 --remove-duplicates --rolestats --keywords] > > Notes: > Using "-f directory" may give unexpected results: > @@ -1312,7 +1314,7 @@ sub get_list_role { > } > > sub add_categories { > - my ($index) =3D @_; > + my ($index, $suffix) =3D @_; > > my $i; > my $start =3D find_starting_index($index); > @@ -1342,7 +1344,7 @@ sub add_categories { > if (!$hash_list_to{lc($list_address)}) { > $hash_list_to{lc($list_address)} =3D 1; > push(@list_to, [$list_address, > - "subscriber list${list_role}"= ]); > + "subscriber list${list_role}"= . $suffix]); > } > } > } else { > @@ -1352,12 +1354,12 @@ sub add_categories { > if ($email_moderated_list) { > $hash_list_to{lc($list_address)} =3D = 1; > push(@list_to, [$list_address, > - "moderated list${list= _role}"]); > + "moderated list${list= _role}" . $suffix]); > } > } else { > $hash_list_to{lc($list_address)} =3D 1; > push(@list_to, [$list_address, > - "open list${list_role}"])= ; > + "open list${list_role}" .= $suffix]); > } > } > } > @@ -1365,19 +1367,19 @@ sub add_categories { > } elsif ($ptype eq "M") { > if ($email_maintainer) { > my $role =3D get_maintainer_role($i); > - push_email_addresses($pvalue, $role); > + push_email_addresses($pvalue, $role . $suffix); > } > } elsif ($ptype eq "R") { > if ($email_reviewer) { > my $subsystem =3D get_subsystem_name($i); > - push_email_addresses($pvalue, "reviewer:$subsystem"); > + push_email_addresses($pvalue, "reviewer:$subsystem" .= $suffix); > } > } elsif ($ptype eq "T") { > - push(@scm, $pvalue); > + push(@scm, $pvalue . $suffix); > } elsif ($ptype eq "W") { > - push(@web, $pvalue); > + push(@web, $pvalue . $suffix); > } elsif ($ptype eq "S") { > - push(@status, $pvalue); > + push(@status, $pvalue . $suffix); > } > } > } > > --- > base-commit: cbf3a2cb156a2c911d8f38d8247814b4c07f49a2 > change-id: 20231004-get_maintainer_change_k-46a2055e2c59 > > Best regards, > -- > Justin Stitt > [1]: https://lore.kernel.org/all/eea5087a2bd94b80b5a16af95a4caf20376bbc52.c= amel@perches.com