From 14454a6be768159c611e4fb892bf08b1efcd6b89 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 17 Mar 2023 20:31:37 +0000 Subject: config: glob2re supports `**' to match multiple path components This should match behavior documented in gitglossary(7) --- lib/PublicInbox/Config.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Config.pm') diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 34abcea3..4065b256 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -580,6 +580,7 @@ sub squote_maybe ($) { } my %re_map = ( '*' => '[^/]*?', '?' => '[^/]', + '/**' => '/.*', '**/' => '.*/', '/**/' => '/.*?', '[' => '[', ']' => ']', ',' => ',' ); sub glob2re ($) { @@ -593,7 +594,7 @@ sub glob2re ($) { if ($re =~ s!\A([a-z0-9\+]+://\[[a-f0-9\:]+\](?::[0-9]+)?/)!!i) { $schema_host_port = quotemeta $1; # "http://[::1]:1234" } - my $changes = ($re =~ s!(.)! + my $changes = ($re =~ s!(/\*\*/|\A\*\*/|/\*\*\z|.)! $re_map{$p eq '\\' ? '' : do { if ($1 eq '[') { ++$in_bracket } elsif ($1 eq ']') { --$in_bracket } -- cgit v1.2.3-24-ge0c7