Re: [PATCH 1/8] Add scripts/get_maintainer.pl

From: Joe Perches
Date: Mon Oct 27 2008 - 19:47:12 EST


On Mon, 2008-10-27 at 15:52 -0700, Andrew Morton wrote:
> On Thu, 23 Oct 2008 16:09:19 -0700
> Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> > A script to parse file pattern information in MAINTAINERS
> > and return selected information about a file or patch
> >
> > $ scripts/get_maintainer.pl
> > usage: ./scripts/get_maintainer.pl [options] patchfile
> > ./scripts/get_maintainer.pl [options] -f file
> > version: 0.12
>
> Example output would be nice to see. Hopefully it is in the
>
> Joe Perches <joe@xxxxxxxxxxx>
>
> form, ready to be pasted into an email client?

Yes. It's also suitable for use with git-send-email --cc-cmd

Some examples picking a random file (drivers/net/b44.c):

Get maintainers for a single file
(this includes git -by: signatories and the script does a
sort | uniq so the maintainer is not listed first)

$ ./scripts/get_maintainer.pl -f drivers/net/b44.c
"Miguel BotÃn" <mboton@xxxxxxxxx>
Gary Zambrano <zambrano@xxxxxxxxxxxx>
Jeff Garzik <jeff@xxxxxxxxxx>
Jeff Garzik <jgarzik@xxxxxxxxx>
John W. Linville <linville@xxxxxxxxxxxxx>
Larry Finger <Larry.Finger@xxxxxxxxxxxx>
Michael Buesch <mb@xxxxxxxxx>
netdev@xxxxxxxxxxxxxxx

without -git signators

$ ./scripts/get_maintainer.pl -f --nogit drivers/net/b44.c
Gary Zambrano <zambrano@xxxxxxxxxxxx>
Jeff Garzik <jgarzik@xxxxxxxxx>
netdev@xxxxxxxxxxxxxxx

or without mailing lists

$ ./scripts/get_maintainer.pl -f --nogit --no-l drivers/net/b44.c
Gary Zambrano <zambrano@xxxxxxxxxxxx>
Jeff Garzik <jgarzik@xxxxxxxxx>

or without the maintainers, just mailing lists

$ ./scripts/get_maintainer.pl -f --nogit --no-m drivers/net/b44.c
netdev@xxxxxxxxxxxxxxx

or get the scm entry

$ ./scripts/get_maintainer.pl -f --nogit --no-email --scm drivers/net/b44.c
git git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git

> otoh, we'll sometimes also want the
>
> joe@xxxxxxxxxxx,akpm@xxxxxxxxxxxxxxxxxxxx
>
> form for use by scripts.

That's the --no-multiline option

$ ./scripts/get_maintainer.pl -f --nogit --no-multiline drivers/net/b44.c
Gary Zambrano <zambrano@xxxxxxxxxxxx>, Jeff Garzik <jgarzik@xxxxxxxxx>, netdev@xxxxxxxxxxxxxxx

Another possibility is to use a patch file: (random old patch file)

$ cat pad.d
diff --git a/drivers/crypto/padlock-sha.c b/drivers/crypto/padlock-sha.c
index c666b4e..1d7c328 100644
--- a/drivers/crypto/padlock-sha.c
+++ b/drivers/crypto/padlock-sha.c
@@ -251,7 +251,7 @@ static struct crypto_alg sha256_alg = {

static int __init padlock_init(void)
{
- int rc = -ENODEV;
+ int rc;

if (!cpu_has_phe) {
printk(KERN_ERR PFX "VIA PadLock Hash Engine not detected.\n");
$ ./scripts/get_maintainer.pl pad.d
Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Jeremy Katz <katzj@xxxxxxxxxx>
Suresh Siddha <suresh.b.siddha@xxxxxxxxx>
Wolfgang Walter <wolfgang.walter@xxxxxxx>

> MAINTAINERS | 1096 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 1094 insertions(+), 2 deletions(-)
>
> isn't practical for me or Stephen to carry, I'm afraid. That's
> probably the most-patched file in the kernel. This will need to be a
> direct you->Linus thing.

I also think it has to be picked up directly by Linus.

MAINTAINERS is not just probably the most patched file.
It _is_ the most patched file.

$ git log --pretty=oneline --stat | \
grep -vP "^[a-f0-9]{40,40}" | \
grep -vP "changed.*insertion.*deletion" | \
cut -f1 -d"|" | sed -e 's/ //g' | \
sort | uniq -c | sort -nr | head -5
733 MAINTAINERS
718 kernel/sched.c
440 include/linux/sched.h
411 include/linux/libata.h
407 include/linux/ide.h

> I think the feature is sorely needed and will prove useful.

thanks...

cheers, Joe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/