[Linux-kernel-mentees] Potential new task: a new self-test in get-maintainers.pl

Lukas Bulwahn lukas.bulwahn at gmail.com
Thu Nov 19 08:29:48 UTC 2020

On Thu, Nov 19, 2020 at 9:10 AM Joe Perches <joe at perches.com> wrote:
> On Thu, 2020-11-19 at 08:38 +0100, Lukas Bulwahn wrote:
> > Hi Aditya, Hi Dwaipayan,
> >
> > here another potential task for some perl work:
> >
> > Implement a new self-test in get-maintainers.pl that checks if a file
> > entry line is already covered by the others provided, i.e., all files
> > matching to one file entry line is already matched by all the other
> > file entry lines of the same section.
> >
> > Here is a quick example where I did something wrong of that kind:
> > https://lore.kernel.org/netfilter-devel/20201109091942.32280-1-lukas.bulwahn@gmail.com/
> >
> > This needs a bit of reading and understanding the MAINTAINERS file and
> > what get_maintainers.pl does with those entries. get-maintainers.pl
> > already implements some self-test checks and you can add this check
> > above to the existing ones.
> I think that's a pretty trivial defect.  Overlaps aren't fatal.

Thanks, I agree it is not fatal, it is just nice if we can keep

> Renames and moves are pretty common though and the maintainers
> F: and X: patterns aren't always correct/current.
> Perhaps more useful would be a new script that tracks all the various
> commit file moves/renames and maps those to the MAINTAINERS sections
> so that the moved/renamed file patterns in MAINTAINERS are updated.

I agree. I could imagine a patch warning mode (either in a separate
script or in checkpatch.pl) that warns authors with something like:

The file renamings in this patch change the corresponding sections of
those files:


Is this intended?
The following diff will adjust the MAINTAINERS to keep the section
assignments as-is:

Especially when files move from some section to THE REST, it is
probably unintended.

> That's rather out-of-scope for both get_maintainer.pl and checkpatch.pl
> A trivial script I wrote and used a couple years ago is attached.
> https://lore.kernel.org/lkml/da894e81adc28ac98d9c399d24d8eb075b30fd1a.camel@perches.com/

Thanks for the pointer. I think that is a good starting point for
adding more checks of this kind and hopefully, we can somehow wire
those up either in checkpatch.pl or some other checking scripts that
are regularly executed.

> Done using -next with an empty patterns directory
> $ perl ./scripts/get_maintainer.pl --self-test=patterns | \
>   cut -f2 -d: | \
>   while read line ; do \
>     perl ./dump_section.perl $line \
>   done

More information about the Linux-kernel-mentees mailing list