Git Can Track Two Files Your Mac Cannot Check Out
Описание и применение
casecrash обнаруживает файлы, которые различаются только регистром или нормализацией Unicode, что приводит к конфликтам на macOS и Windows. Инструмент помогает выявить и исправить такие коллизии до того, как пользователи столкнутся с грязным рабочим деревом.
Задача
Git tracks two files that macOS cannot check out due to case‑sensitivity and Unicode normalization differences, causing permanently dirty working trees and failed updates.
Результат
casecrash detects and reports filename collisions caused by case differences and Unicode normalization, enabling preemptive renaming and ensuring clean working trees on case‑insensitive filesystems.
Рабочий процесс
- Clone or pull the repository on macOS or Windows
- Run
casecrashto scan for case and Unicode collisions - Review the output and rename any colliding files using
git mv - Commit the renames and push the changes
Доказательства
Git can track two files your Mac cannot check out.
Hermes Agent issue #99821: the repo tracks contributors/emails/[email protected] alongside a twin file whose name differs only by capitalization.
On Linux both files live happily side by side. On a Mac, every clone or pull ends up with a permanently dirty working tree — and hermes update on macOS flat-out refuses to update past it.
So I built casecrash: a tiny zero-dependency Python CLI that automates that one-liner for both collision classes — casefolding and Unicode normalization — and reports exactly which pairs break, and on which platforms.
casecrash: found 2 filename collision(s) in /tmp/demorepo (5 files scanned): [normalization] collide after Unicode normalization (macOS): 'cafe\u0301.md' [NFD] 'caf\u00e9.md' [NFC] -> breaks on: macOS [case] collide on case-insensitive filesystems (macOS, Windows): 'README.md' 'readme.md' -> breaks on: macOS, Windows Fix: rename one of each colliding pair before a macOS/Windows user clones this repo.
It's CI-friendly by design: exit 1 when collisions are found, 0 when clean, 2 on errors.
- Дата записи: 2026-10-03T08:41:10.847Z