Skip to content

diff: fold only ASCII letters for --ignore-file-name-case in the POSIX locale - #381

Open
binhvq wants to merge 4 commits into
uutils:mainfrom
binhvq:ignore-case-ascii-in-c-locale
Open

binhvq wants to merge 4 commits into
uutils:mainfrom
binhvq:ignore-case-ascii-in-c-locale

Conversation

@binhvq

@binhvq binhvq commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #356.

fold_file_name_case always used Unicode lowercasing, so É and é were the same name with --ignore-file-name-case even in the C locale, where GNU only folds ASCII letters.

It now checks LC_CTYPE with the existing is_posix_locale (LC_ALL > LC_CTYPE > LANG, C when unset) and folds ASCII only in the POSIX locale. Exit status matches GNU diff 3.12 for the locale combinations in the test.

Unix only: on Windows these variables are normally unset, and I didn't want to change the folding there.

…X locale

File names were always lowercased as Unicode text, so names such as É and é matched in the C locale, where GNU diff keeps them apart. Follow LC_CTYPE and fold only the ASCII letters in the POSIX locale.
@codspeed

codspeed Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 4.61%

2 warnings

⚠️ 24 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

❌ 1 regressed benchmark
✅ 25 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ cmp_parser 10.3 µs 10.8 µs -4.61%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing binhvq:ignore-case-ascii-in-c-locale (2cf1c17) with main (5a55160)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (854d777) during the generation of this report, so 5a55160 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@binhvq

binhvq commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

The CodSpeed result looks like noise: the only change is in fold_file_name_case, which the cmp parser never calls, and the report flags cmp_parser as run on different hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

diff - --ignore-file-name-case folds non-ASCII letters in the C locale

1 participant