Repository navigation
Conversation
mathiasrw
added this pull request to stack #765
October 23, 2026 00:30
mathiasrw
force-pushed
the
fix/718
branch
3 times, most recently
from
October 23, 2026 00:36
8216bc8 to
991ac59
Compare
… ! and --exclude-glob
…e last on the full path when asked
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #718
Stacked on #749. Merge that first.
Change
How the files are found, in this order:
a[1].md,my (1).mdor[id].tsx, gives only that file. The other paths are globbed together, so a glob that starts with!still takes files away from the other globs.--absolute-patheach file is known by its full path from here on.--exclude-glob(-X) values are globbed together as one group. They are always globs, also when one is the name of a file, so!can be used in them too../a.mdanda.mdare the same file.--exclude-re(-x) takes away every file with a path that matches. With--absolute-paththat is the full path.A file that is found in more than one way is only handled once.
Tests
test/js/fix/718.test.jstests each name in the table of the issue, a file in a folder, and how a path to a file works together with globs, a!glob,--exclude-glob(always a glob, escaped, one group with!) and--exclude-re(also on the full path with--absolute-path).test/cli/run.shtests the same through the CLI.Good to know
!glob does not take away a file given by its path, as that file is not a glob. Todaya.md '!a.md'gives no file. Now it givesa.md. Use-Xor-xto leave it out.-Xis globs only, never files, so-X 'a[1].md'also leaves outa1.md.*.md, then'*.md'gives only that file and no longer all markdown files. This is in the issue.-X 'docs/a*'did not leave out./docs/a.md.-xand-Xis updated.