From: Joe Perches <joe@perches.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Florian Mickler <florian@mickler.org>, "Ted Ts'o" <tytso@mit.edu>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [RFC PATCH] scripts/get_maintainer.pl: Use vcs history of pattern match
Date: Sat, 25 Sep 2010 21:10:11 -0700 [thread overview]
Message-ID: <1285474211.6115.171.camel@Joe-Laptop> (raw)
When users make changes to individual files in a directory,
git history of just that file is searched. This can lead
to poor generated results as the directory could actually
be the preferred history unit to find maintainers.
When a file has an exact pattern match, which may be a
directory, search the pattern matched rather than the file.
This may not work well for file in an active directory
like kernel/, because it does not have a named maintainer.
Signed-off-by: Joe Perches <joe@perches.com>
---
scripts/get_maintainer.pl | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index d21ec3a..9a3627a 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -508,6 +508,7 @@ sub get_maintainers {
@status = ();
%deduplicate_name_hash = ();
%deduplicate_address_hash = ();
+
if ($email_git_all_signature_types) {
$signature_pattern = "(.+?)[Bb][Yy]:";
} else {
@@ -515,8 +516,8 @@ sub get_maintainers {
}
# Find responsible parties
-
my %exact_pattern_match_hash = ();
+ my %matched_pattern_hash = ();
foreach my $file (@files) {
@@ -558,6 +559,7 @@ sub get_maintainers {
$value_pd = -1 if ($value =~ /^\.\*/);
if ($value_pd >= $file_pd) {
$exact_pattern_match_hash{$file} = 1;
+ $matched_pattern_hash{$value}++;
}
if ($pattern_depth == 0 ||
(($file_pd - $value_pd) < $pattern_depth)) {
@@ -608,7 +610,13 @@ sub get_maintainers {
if ($email &&
($email_git || ($email_git_fallback &&
!$exact_pattern_match_hash{$file}))) {
- vcs_file_signoffs($file);
+ my $vcs_pattern;
+ if (scalar keys %matched_pattern_hash) {
+ $vcs_pattern = join(" ", keys %matched_pattern_hash);
+ } else {
+ $vcs_pattern = $file;
+ }
+ vcs_file_signoffs($vcs_pattern);
}
if ($email && $email_git_blame) {
vcs_file_blame($file);
reply other threads:[~2010-09-26 4:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1285474211.6115.171.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=florian@mickler.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).