Attack of the Case Sensitive Filesystem

Case sensitive file systems should be retired.

They allow us to do stupid things, mostly in error, but sometimes because we are too smart for our own good. There is no good reason for their (continued) existence.

I imagine that in the ancient days of computing it came about something like:

“Long file names will take up too much space”

“I know, we can make the file system case sensitive.”

“Great, now instead of ‘work-notes.txt’ and ‘notes-about-homebuilding.txt’, I’ll just name the files ‘notes’ and ‘Notes”.

Software developers are known for our passion for backward compatibility, and so today the popular file systems of Linux and Unix (except Mac) are still case sensitive.

Gross!

What has gotten me worked up about this (again)?

The cause this time is a customer checked into subversion two copies of a file just with different case. From the commit log, it seems likely that they meant to rename the file.

When I tried to update (or check out) the repository on Mac OS X (10.5.6), a case preserving, but case-insensitive file system (doing the right thing), it fails with a cryptic message:

svn: In directory 'images/author_header'
svn: Can't copy 'images/author_header/.svn/tmp/text-base/belief.jpg.svn-base' to 'images/author_header/.svn/tmp/belief.jpg.tmp.tmp': No such file or directory

using the pre-packaged svn 1.4.4 (r25188 – built Nov 25 2007). Out of interest, I used macports to upgrade to 1.5.5 (r34862) and the error is different but equally cryptic:

svn: In directory 'images/author_header'
svn: Can't open file 'images/author_header/.svn/tmp/text-base/belief.jpg.svn-base': No such file or directory

At this point, I had not identified the cause of the problem, so I was quite frustrated. Thankfully, I had a Linux box to check out the repository on and from there the issue looked obvious.

Solutions?

Save us from our selves.

When working on developing the next great file system, make it so amazing that you can slip in case preserving, case insensitivity like Mac OS X’s HFS+ (Mac OS Extended).

When developing tools like the next great revision control system don’t allow files of the same name but different case — the default configuration anyway.  Failing that, have good error messages. 

It’s not too late for Subversion either to fix the long rotten issue 667: handle file name case sensitivity edge cases (issue 2010: case sensitivity problem with checkout )

Update April 2, 2011: two years later, newer version of Mac OS X, and SVN, and I encounter the same problem:

$ svn up
svn: In directory 'macleans3/images/maps'
svn: Can't open file 'macleans3/images/maps/.svn/tmp/textbase/BQ_old.png.svn-base': No such file or directory

lloyd-imac:macleans3 lloyd$ svn cleanup
svn: In directory 'images/maps'
svn: Error processing command 'modify-wcprop' in 'images/maps'
svn: 'images/maps/bq_old.png' is not under version control

Again, after looking around for easy solutions on the Mac, I just logged into a Linux box, and checked out there, removed the duplicate file names, and committed.