Case Sensitivity

So, I ran into a really minor case problem in some web software I was working with in a git repository. Several files had the case of the names changed. I had a lot of trouble fixing this issue, and it took me a really long time to figure out what was wrong, because the files were testing-related files so they didn’t impact the function of the software. I recognize this is really unlikely to ever happen again, but, I’ve become a bit obsessed with avoiding it. I am personally completely comfortable with using a CS OS, and would actually prefer it, but I understand it’s not recommended to convert the primary storage to a case sensitive format.

What do you think is the best way to handle this? I’ve created a small DMG that is formatted to be case sensitive and moved some of my projects onto it. But it isn’t automatically mounted whenever I restart (I play windows games using Bootcamp). Should I create a small partition and add a symbolic link in my user directory?

I think what’s probably easier is to make it a rule for this repository that file names cannot be case-sensitive and check it on PRs.

Or, you could even create a quick little script for detecting duplicate filenames and run it in a CI pipeline.

Both of those seem easier than keeping your repository on a case sensitive disk for this one project.

Edit: quick little script for duplicate filenames (should detect failures with the conversion of filename to uppercase)

fd -x echo "{}" | tr [a-z] [A-Z] > names.txt
sort names.txt | uniq -c | grep -v '^ *1 '

I’m not dealing with PRs. The problem is that I’m dealing with a pretty large web project that isn’t following best practices for how to manage the codebase. So, I’m committing code that is managed by a package manager, and that project is apparently sometimes committing filename changes that only change the case. So those changes are not always immediately obvious. Currently, my command line git interface tells me that I’m working on a clean working tree, but when I look at the Git tab of the Nova editor sidebar, it tells me that a file has been deleted. The file is related to testing, so it’s not critical to the production function of the project. I’m in the process of changing the code management process, so that I’m no longer committing code managed by the package manager, but I’m still a month or so away from making the switch permanently.

I really, really wish macOS could just be case sensitive, and provide some kind of remediation for people who are not familiar with it.

Also, the problem isn’t duplicate filenames, the problem is that filenames get their case changed, and it’s not properly changed in my local dev environment filesystem/git repo. But I don’t understand how or why this happens. I suppose I could go into the source repository that the package manager is pulling the code updates from, but it’s not always obvious when these changes happen, and the only way I can figure out how to resolve the problem is to checkout a fresh copy of the codebase to figure out what the actually correct filename is, and then make 2 commits to remove the offending file and add it back with the correctly capitalized filename. But even after all that, I think I actually have to merge each of those commits into master separately, or I encounter the same problem when I checkout master and merge the branch. And I imagine if I ever checkout an old branch or an old commit (admittedly a very rare occurrence), I’ll encounter exactly the same problem, where at that point I have to completely remove a parent directory or the whole repository.