On Mon, 2026-03-02 at 01:50 +0100, Matteo Croce wrote:
> ```
> Il giorno dom 1 mar 2026 alle ore 17:42 Joe Perches 
> <[[email protected]](mailto:[email protected])>
> ha scritto:
> 
> > On Sun, 2026-03-01 at 12:17 +0100, Matteo Croce wrote:
> BTW at this point it would be useful to implement the ** glob operator,
> > > but maybe it's not worth it.
> 
> > 
> > Hi Matteo.
> > 
> > Given you've now touched get_maintainer, you are welcome to do it.
> > Maybe change "sub file_match_pattern {".
> > But I believe this is the first actual use case so I will not.
> 
> 
> Mmm not really the first usage, I see this pattern being already used:
> 
> $ grep -F '/*/*/' MAINTAINERS
> F: Documentation/devicetree/bindings/*/*/*ma35*
> F: drivers/*/*/*ma35*
> F: Documentation/devicetree/bindings/*/*/*npcm*
> F: drivers/*/*/*npcm*
> F: arch/*/*/*/*ftrace*
> F: arch/*/*/*ftrace*
> F: drivers/net/ethernet/*/*/*/*/*xdp*
> F: drivers/net/ethernet/*/*/*xdp*

Nope.

Those are specific directory depth matches.
Your use case is _all_ directory depth matches.

> I tried to implement it and seems easier than expected, the chunk below does 
> it
> (validated with: scripts/get_maintainer.pl --self-test=patterns)
> 
> --- a/scripts/get_maintainer.pl
> +++ b/scripts/get_maintainer.pl

This doesn't apply as there are tab/space problems.

> @@ -375,7 +375,9 @@ sub read_maintainer_file {
[]
> @@ -1045,12 +1050,8 @@ sub file_match_pattern {
>       return 1;
>   }
>      } else {
> - if ($file =~ m@^$pattern@) {
> -     my $s1 = ($file =~ tr@/@@);
> -     my $s2 = ($pattern =~ tr@/@@);
> -     if ($s1 == $s2) {
> - return 1;
> -     }
> + if ($file =~ m@^$pattern$@) {
> +     return 1;

and I think the count of / characters matters
but if you send a patch that applies, I'll verify.

cheers, 
>   }
>      }
>      return 0;
> 
> Regards,
> 
> ```

Reply via email to