Attention is currently required from: Felix Singer, Nico Huber, Paul Menzel, Angel Pons. Hello Felix Singer, build bot (Jenkins), Nico Huber, Patrick Georgi, Paul Menzel, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/52275
to look at the new patch set (#3).
Change subject: maintainers.go: correct handling of globs ......................................................................
maintainers.go: correct handling of globs
maintainers.go does not handle globs as described in MAINTAINERS. Instead of only matching the files inside a directory, it also matches everything below. Also, a glob used in between (`e.g. path/to/*/dir`) could lead to matching many more paths unexpectedly.
This is caused by the way paths using globs are converted to regegular expressions for use with gerrit:
1. The script converts all paths with trailing slash to a path with trailing glob. That means, a recursive match on a directory gets converted to match only the files in the directory (at least according to the documentation - if there wasn't 2).
Example: `path/to/dir/` becomes `path/to/dir/*`
2. When converting the path to a regex, all globs get converted to prefix matching by replacing the glob by `.*`. Instead of only matching the files in the directory, everything below matches, which is a) not what the documentation states and b) the opposite of what 1. did first.
Example: `path/to/dir/*` becomes `^path/to/dir/.*$`
In sum, this leads to all sorts of issues. Examples: - `path/*/dir` becomes `^path/.*/dir$` - `path/to/dir/*` becomes `^path/to/dir/.*$` - `path/to/*.c` becomes `^path/to/.*.c$`
This change fixes that behaviour by: - dropping the wrong conversion from 1. above. - fixing glob matching by replacing `*` by `[^/]`. - handling paths with trailing `/` as prefix, as documented.
The change was not splitted because these changes depend on each other and splitting would break recursive matching between the commits.
Tests: 1. diffed output before and after is equal (!= the same) 2. manual testing of glob matching
Change-Id: I4347a60874e4f07e41bdee43cc312547bea99008 Signed-off-by: Michael Niewöhner foss@mniewoehner.de --- M util/scripts/maintainers.go 1 file changed, 8 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/52275/3