Repository navigation
Commit a86d09b
authored
fix: a glob's
relative_path_matches_glob consumed `**/` and then retried the rest of
the pattern at every character of the path, so what followed `**/`
could begin in the middle of a file or directory name. `**/main.cpp`
selected `src/domain.cpp`, `tests/**/test_*.cpp` selected
`tests/mytest_a.cpp`, and `**/modules/dnn/**/*.avx2.cpp` selected
`a/submodules/dnn/l.avx2.cpp`.
The matcher serves every glob with the `sources` grammar: `sources`,
`[build] flags`, `[scan_overrides]`, test `discover`, `[pack]
include`/`exclude`, include-dir globs and `rerun_if_changed_glob`. A
`[build] flags` entry for `**/main.cpp` therefore also compiled
`src/app/domain.cpp` with its defines.
After `**/` the rest of the pattern now resumes only where it stands
(zero directories) or just after a `/`. A `**` not followed by `/`
(`src/**`, `src/**.cpp`) keeps crossing segments and names as before.
The literal-prefix and tail pre-filters of expand_glob are supersets of
the new match and are unchanged.
Tests: Glob.ADoubleStarSlashStandsForWholeDirectories checks the matcher
directly, and Scanner.ADoubleStarSlashTailMatchesAtTheRoot gains a
`sub/domain.cpp` that the `**/main.cpp` walk must not return. docs/04
states the rule in both languages.
Closes #877**/ stands for whole directories, not part of a name (#878)1 parent 6028cce commit a86d09b
4 files changed
Lines changed: 51 additions & 5 deletions
File tree
- docs
- zh
- modules/manifest/src
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
560 | 565 | | |
561 | 566 | | |
562 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
533 | 538 | | |
534 | 539 | | |
535 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
214 | 218 | | |
215 | | - | |
| 219 | + | |
| 220 | + | |
216 | 221 | | |
217 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
218 | 225 | | |
219 | | - | |
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1444 | 1444 | | |
1445 | 1445 | | |
1446 | 1446 | | |
1447 | | - | |
| 1447 | + | |
| 1448 | + | |
1448 | 1449 | | |
1449 | 1450 | | |
1450 | 1451 | | |
1451 | 1452 | | |
1452 | 1453 | | |
| 1454 | + | |
1453 | 1455 | | |
1454 | 1456 | | |
1455 | 1457 | | |
1456 | 1458 | | |
1457 | 1459 | | |
1458 | 1460 | | |
1459 | 1461 | | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
0 commit comments