Case Sensitivity, Windows, Linux and Git

“It’s a Madhouse” for $200, Chuck.

This is a strange one . . .

Most of our development for a services project is done on Windows. Java, Spring, Hibernate, Drools, JAX-WS. I was integrating some more service calls and refactored the names of a few classes from (something like):

CALLService.java
CALLServiceImpl.java

to

CallService.java
CallServiceImpl.java

Sounds pretty simple, right? Checked it into Git running ff a Stash server, and everything was building fine. We did not however have a Hudson build running off this particular branch to check it for sure, but still, we were all good.

Along comes a developer working on Linux. He checks out the code and BAM it breaks. Spring is complaining, need unique service names. Now way! I check out the code on my own Linux instance, and the build fails. Looking in the code I see this in the Linux version of the project’s services directory AND I see this out in Stash:

CALLService.java
CALLServiceImpl.java
CallService.java
CallServiceImpl.java

No kidding! Going back to my Windows machine I do a fresh clone, and look in that same directory. What do you think I see?

CallService.java
CallServiceImpl.java

LOL! No sign of the upper case classes!  It builds too.

My solution — I go back to Linux, delete the CALL files, check that in. Now Linux builds fine, but guess what? Back on Windows, I do a few “git gc” cleanup calls and it keeps wanting to delete the Call files I want to keep; gosh. Do I need to re-add, again?  Ugh.   Instead I do another git pull –rebase, and on Windows, finally, it’s all good, on Linux it’s all good, and Stash is all good.

Side note: I also got the old “LF will be replaced by CRLF when operating on some files.” errors from git on some operations.  I noticed quite a few files were being checked in as ISO-8559  from the Linux developers, and I  set myself up as UTF-8 on Windows to mesh with them in the first place!  It’s a madhouse!  Won’t get into it today, but it made for some interesting editor experiences.

Theories?

I tried spiking this out through a GitBlit I had running on my Linux machine.  I made a project, checked it out, did some case-sensitivity-changes in Windows.  But I never saw this error on the Linux machine after checking them in.  I stopped there, and don’t want to mess with Stash anymore.  I remember Gitblit has problems with cache cleaning and showing multiple project views of the same project, but this was different.

Windows is notirious for being not-case-sensitive, and Linux is.  I am guessing, somewhere, I made the case changes and checked them in but a disconnect happend with the Stash server that saw the changes as new files.  On SVN a rename = add + delete. That makes it problematic when the sysadmins are messing with permissions and preventing deletes.  Maybe our sysadmins stopped my delte permissions for a day.   Then during this operation the add was executed, but not the drop — and a Linux Stash server certainly could have seen the case changes as new files.

During checkout, Windows sees the files as the same.  And some hocus pocus writes over the old names.  But Linux was never fooled for a second.

I don’t know.  I found the problem, I fixed it. In the industry sometimes I can’t spend three days figuring out something.  I note it, throw it in the team wiki, make a blog post and move on.

,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>