Re: [PATCH 0/10] MAINTAINERS - script, patterns, and misc fixes

Andrew Morton
2009-01-13T20:55:53Z

On Tue, 13 Jan 2009 12:28:08 -0800
Joe Perches <joe@perches.com> wrote:

> This patchset adds a script to find the maintainer
> of an individual file or files in a patch and
> additional patterns to MAINTAINERS.
>
> Other information from MAINTAINERS sections can
> also be generated by file or patch.

I applaud the intent.

This patchset is basically unmergeable by anyone except Linus - it
already gets three rejects against half-hour-old mainline.

We need to ensure that scripts/get_maintainer.pl gets its "x" bit set,
somehow (you lose it if you just apply the patch). Perhaps the
instructions should say

perl scripts/get_maintainer.pl ...

rather than just

scripts/get_maintainer.pl ...

How does it work, anyway?

akpm:/usr/src/git26> ../25/scripts/get_maintainer.pl -f mm/filemap.c
Balbir Singh <balbir@linux.vnet.ibm.com>
Hugh Dickins <hugh@veritas.com>
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Miklos Szeredi <mszeredi@suse.cz>
Nick Piggin <npiggin@suse.de>

I think Balbir would be surprised!

akpm:/usr/src/git26> ../25/scripts/get_maintainer.pl -f fs/ext3/super.c
Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Christoph Hellwig <hch@lst.de>
Jan Blunck <jblunck@suse.de>
Jan Kara <jack@suse.cz>
Marcin Slusarz <marcin.slusarz@gmail.com>

mm.. spose so, but it isn't terribly accurate. Does it take
signed-off-by:s and/or the git Commit: header into account?

akpm:/usr/src/git26> ../25/scripts/get_maintainer.pl -f fs/xfs/xfs.h
Christoph Hellwig <hch@infradead.org>
Donald Douwsma <donaldd@sgi.com>
Eric Sandeen <sandeen@sandeen.net>
Lachlan McIlroy <lachlan@sgi.com>
Tim Shimmin <tes@sgi.com>

OK, that was an easy case.

It's a bit slow. That's git's fault. Perhaps some git person will be
able to suggest ways of speeding it up.

akpm:/usr/src/git26> ../25/scripts/get_maintainer.pl -f mm/pdflush.c
Ingo Molnar <mingo@elte.hu>
Jesper Juhl <jesper.juhl@gmail.com>
Mike Travis <travis@sgi.com>
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Pavel Machek <pavel@suse.cz>

again, not the result I'd have expected!

But I guess we can fine-tune these thnigs after we get the bulk of it
settled in.

My script generates what I consider to be better results:

akpm:/usr/src/25> who-maintains.sh mm/filemap.c
Nick Piggin <npiggin@suse.de>
Hugh Dickins <hugh@veritas.com>
Fengguang Wu <wfg@mail.ustc.edu.cn>
Christoph Hellwig <hch@lst.de>
Steven Whitehouse <swhiteho@redhat.com>
Zach Brown <zach.brown@oracle.com>
Miklos Szeredi <mszeredi@suse.cz>
Jan Kara <jack@suse.cz>
Balbir Singh <balbir@linux.vnet.ibm.com>
Badari Pulavarty <pbadari@us.ibm.com>

For some (git related) reason it is vastly slower than yours.

#!/bin/sh
#
# Usage: who-maintains.sh file1 file2 ..
#

TMP=$(mktemp /tmp/who-maintains-XXXXXX)
TMP2=$(mktemp /tmp/who-maintains2-XXXXXX)
TMP=/tmp/1
TMP2=/tmp/2
GITDIR=/usr/src/git26

cd $GITDIR

FILES=""
for i in $*
do
if [ -e $i ]
then
FILES=$FILES" $i"
fi
done

if [ x"$FILES" == "x" ]
then
exit 0
fi

git whatchanged $FILES > $TMP

cat $TMP |
(
egrep "Author:|Signed-off-by:" |
grep -v torvalds |
grep -v akpm |
sed -e 's/^[ ]*//' |
sed -e 's/Signed-off-by:[ ]*//' |
sed -e 's/Author:[ ]*//' |
sort
) > $TMP2

LAST=""
COUNT=0

grokkit()
{
while read NAME
do
if [ "$NAME" == "$LAST" ]
then
COUNT=$(expr $COUNT + 1)
else
if [ x"$LAST" != "x" ]
then
echo $COUNT $LAST
fi
LAST="$NAME"
COUNT=1
fi
done
if [ x"$LAST" != "x" ]
then
echo $COUNT $LAST
fi
}

grokkit < $TMP2 | sort -nr | head -n 10 | sed -e 's/[0-9]* //'

#rm -f $TMP $TMP2