fs: fix glob case-sensitivity inconsistencies by louiellan · Pull Request #63446 · nodejs/node · GitHub
Skip to content

fs: fix glob case-sensitivity inconsistencies - #63446

Closed
louiellan wants to merge 1 commit into
nodejs:mainfrom
louiellan:fix-exclude-glob
Closed

louiellan wants to merge 1 commit into
nodejs:mainfrom
louiellan:fix-exclude-glob

Conversation

@louiellan

@louiellan louiellan commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Refs: #58991

fix matchers' nocaseMagicOnly option where it makes any non-magical/literal pattern case-sensitive which results to:

  1. making the exclude option case sensitive

  2. not returning the actual casing of a matched directory / file

not ideal for the case-insensitive nature of Windows and MacOS filesystems.

It would be a notable-change since developers may have been relying already on this behavior

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels May 20, 2026
@louiellan

louiellan commented May 20, 2026 •

Copy link
Copy Markdown
Contributor Author

where the `exclude` option is case sensitive but the `pattern` is a
case insensitive operation (on Windows and MacOS), thus results to
any casing difference in matched list not to be filtered out and does
not return the true casing of a matched directory / file

Signed-off-by: louiellan <louie.lou.llaneta@gmail.com>
@louiellan louiellan changed the title fs: fix glob case mismatch on Windows and MacOS fs: fix glob case-sensitivity inconsistencies May 20, 2026
@codecov

codecov Bot commented Jun 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.08%. Comparing base (4ee7567) to head (a1aa147).
⚠️ Report is 204 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63446      +/-   ##
==========================================
+ Coverage   90.05%   90.08%   +0.03%     
==========================================
  Files         714      714              
  Lines      225876   225918      +42     
  Branches    42737    42745       +8     
==========================================
+ Hits       203408   203514     +106     
+ Misses      14244    14185      -59     
+ Partials     8224     8219       -5     
Files with missing lines Coverage Δ
lib/internal/fs/glob.js 91.48% <100.00%> (ø)

... and 35 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@louiellan

Copy link
Copy Markdown
Contributor Author

@louiellan louiellan closed this Jun 6, 2026
yhay81 added a commit to yhay81/node that referenced this pull request Aug 31, 2026
On case-insensitive platforms include patterns match entries
regardless of case, but literal (non-magic) exclude patterns were
matched case-sensitively because exclude matchers are created with
nocaseMagicOnly. Exclusion is a pure string match with no filesystem
lookups, so disable nocaseMagicOnly for exclude matchers.

Fixes: nodejs#58991
Refs: nodejs#63446
Signed-off-by: Yusuke Hayashi <yusuke8h@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request Sep 3, 2026
On case-insensitive platforms include patterns match entries
regardless of case, but literal (non-magic) exclude patterns were
matched case-sensitively because exclude matchers are created with
nocaseMagicOnly. Exclusion is a pure string match with no filesystem
lookups, so disable nocaseMagicOnly for exclude matchers.

Fixes: #58991
Refs: #63446
Signed-off-by: Yusuke Hayashi <yusuke8h@gmail.com>
PR-URL: #64817
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
aduh95 pushed a commit that referenced this pull request Sep 3, 2026
On case-insensitive platforms include patterns match entries
regardless of case, but literal (non-magic) exclude patterns were
matched case-sensitively because exclude matchers are created with
nocaseMagicOnly. Exclusion is a pure string match with no filesystem
lookups, so disable nocaseMagicOnly for exclude matchers.

Fixes: #58991
Refs: #63446
Signed-off-by: Yusuke Hayashi <yusuke8h@gmail.com>
PR-URL: #64817
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
aduh95 pushed a commit that referenced this pull request Sep 15, 2026
On case-insensitive platforms include patterns match entries
regardless of case, but literal (non-magic) exclude patterns were
matched case-sensitively because exclude matchers are created with
nocaseMagicOnly. Exclusion is a pure string match with no filesystem
lookups, so disable nocaseMagicOnly for exclude matchers.

Fixes: #58991
Refs: #63446
Signed-off-by: Yusuke Hayashi <yusuke8h@gmail.com>
PR-URL: #64817
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
aduh95 pushed a commit that referenced this pull request Sep 19, 2026
On case-insensitive platforms include patterns match entries
regardless of case, but literal (non-magic) exclude patterns were
matched case-sensitively because exclude matchers are created with
nocaseMagicOnly. Exclusion is a pure string match with no filesystem
lookups, so disable nocaseMagicOnly for exclude matchers.

Fixes: #58991
Refs: #63446
Signed-off-by: Yusuke Hayashi <yusuke8h@gmail.com>
PR-URL: #64817
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
aduh95 pushed a commit that referenced this pull request Sep 19, 2026
On case-insensitive platforms include patterns match entries
regardless of case, but literal (non-magic) exclude patterns were
matched case-sensitively because exclude matchers are created with
nocaseMagicOnly. Exclusion is a pure string match with no filesystem
lookups, so disable nocaseMagicOnly for exclude matchers.

Fixes: #58991
Refs: #63446
Signed-off-by: Yusuke Hayashi <yusuke8h@gmail.com>
PR-URL: #64817
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants