wildmatch take 3
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | Import wildmatch from rsynct/ wildmatch.c wildmatch.h | +539 | 0 replies | |
| 2/8 | wildmatch: remove unnecessary functionswildmatch.c wildmatch.h | +9 | 0 replies | |
| 3/8 | Integrate wildmatch to git.gitignore Makefile t/ +3 more | +203 | 0 replies | |
| 4/8 | wildmatch: remove static variable force_lower_casetest-wildmatch.c wildmatch.c wildmatch.h | +9 | 4 replies | |
| 5/8 | wildmatch: fix case-insensitive matchingwildmatch.c | +2 | 0 replies | |
| 6/8 | wildmatch: adjust "**" behaviort/ wildmatch.c | +8 | 0 replies | |
| 7/8 | wildmatch: make /**/ match zero or more directoriest/ wildmatch.c | +24 | 0 replies | |
| 8/8 | Support "**" wildcard in .gitignore and .gitattributesDocumentation/ attr.c dir.c +2 more | +82 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/8] wildmatch take 3
Still experimental but the semantics is getting better, I think. Please point out what you think still does not make sense. Quote from the last patch:
Two consecutive asterisks ("**") in patterns matched against full pathname may have special meaning:
- A leading "**" followed by a slash means match in all directories. For example, "**/foo" matches file or directory "foo" anywhere, the same as pattern "foo". "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo".
- A trailing "/**" matches everything inside. For example,
"abc/**" is equivalent to "`/abc/`".
- A slash followed by two consecutive asterisks then a slash matches zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
- Consecutive asterisks otherwise are treated like normal asterisk wildcards.
"abc/**" and "abc/*" are different in attr (the former matches all files, the latter only files directly under abc) while they are the same for ignore. I don't like these subtleties but I don't think we have a choice unless we rework attr matching machinery.
Tests t3070.100 and .101 fail on some machine and not on other due to (I guess) fnmatch behavior changes. Maybe we should fallback on compat/fnmatch in such cases for consistent behavior.
There are problems with asciidoc and "**/" but that's not something we need to care now.
On top of master (and a small conflict with nd/attr-match-optim-more)
Nguyễn Thái Ngọc Duy (8):
Import wildmatch from rsync
wildmatch: remove unnecessary functions Integrate wildmatch to git
wildmatch: remove static variable force_lower_case
wildmatch: fix case-insensitive matching
wildmatch: adjust "**" behavior
wildmatch: make /**/ match zero or more directories Support "**" wildcard in .gitignore and .gitattributes
.gitignore | 1 + Documentation/gitignore.txt | 19 +++ Makefile | 3 + attr.c | 4 +- dir.c | 4 +- t/t0003-attributes.sh | 38 ++++++ t/t3001-ls-files-others-exclude.sh | 19 +++ t/t3070-wildmatch.sh | 184 ++++++++++++++++++++++++++++ test-wildmatch.c | 14 +++ wildmatch.c | 245 +++++++++++++++++++++++++++++++++++++ wildmatch.h | 3 + 11 files changed, 532 insertions(+), 2 deletions(-) create mode 100755 t/t3070-wildmatch.sh create mode 100644 test-wildmatch.c create mode 100644 wildmatch.c create mode 100644 wildmatch.h
Signature · 1 line
1.8.0.rc0.29.g1fdd78f