* [PATCH] [RFC] get_maintainer: Really limit regex patterns to words
@ 2019-06-17 14:23 Geert Uytterhoeven
2019-06-17 16:17 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2019-06-17 14:23 UTC (permalink / raw)
To: Joe Perches, Maxime Coquelin, Alexandre Torgue
Cc: linux-stm32, linux-kernel, Geert Uytterhoeven
Limit file and directory regex matching to paths that contain the
pattern as a word, i.e. that contain word boundaries before and after
the pattern. This helps avoiding false positives.
Without this, e.g. "scripts/get_maintainer.pl -f
tools/perf/pmu-events/arch/x86/westmereex" lists the STM32 maintainers,
due to the presence of "stm" in the middle of a word in the path name.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
What to do with drivers/pwm/pwm-stmpe.c, which is no longer caught?
Add a new pattern to MAINTAINERS?
---
scripts/get_maintainer.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index c1c088ef1420e68a..a34057d87a56492f 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -884,7 +884,7 @@ sub get_maintainers {
}
}
} elsif ($type eq 'N') {
- if ($file =~ m/$value/x) {
+ if ($file =~ m/\b$value\b/x) {
$hash{$tvi} = 0;
}
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] [RFC] get_maintainer: Really limit regex patterns to words
2019-06-17 14:23 [PATCH] [RFC] get_maintainer: Really limit regex patterns to words Geert Uytterhoeven
@ 2019-06-17 16:17 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2019-06-17 16:17 UTC (permalink / raw)
To: Geert Uytterhoeven, Maxime Coquelin, Alexandre Torgue
Cc: linux-stm32, linux-kernel
On Mon, 2019-06-17 at 16:23 +0200, Geert Uytterhoeven wrote:
> Limit file and directory regex matching to paths that contain the
> pattern as a word, i.e. that contain word boundaries before and after
> the pattern. This helps avoiding false positives.
>
> Without this, e.g. "scripts/get_maintainer.pl -f
> tools/perf/pmu-events/arch/x86/westmereex" lists the STM32 maintainers,
> due to the presence of "stm" in the middle of a word in the path name.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> What to do with drivers/pwm/pwm-stmpe.c, which is no longer caught?
> Add a new pattern to MAINTAINERS?
Hi Geert
> diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
[]
> @@ -884,7 +884,7 @@ sub get_maintainers {
> }
> }
> } elsif ($type eq 'N') {
> - if ($file =~ m/$value/x) {
> + if ($file =~ m/\b$value\b/x) {
I'm not sure this is the right approach as it also
affects regexes like
"N: rockchip" where there
are multiple current matches that wouldn't
work anymore.
It might be better to change the regexes in MAINTAINERS
where appropriate.
There is also a regex with a directory slash so it's
probably better to use m{<foo>}
MAINTAINERS:N: /pmac
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-17 16:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 14:23 [PATCH] [RFC] get_maintainer: Really limit regex patterns to words Geert Uytterhoeven
2019-06-17 16:17 ` Joe Perches
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).