{"id":1375,"date":"2014-11-17T14:55:56","date_gmt":"2014-11-17T21:55:56","guid":{"rendered":"http:\/\/10kdev.net\/?p=1375"},"modified":"2014-11-17T15:03:57","modified_gmt":"2014-11-17T22:03:57","slug":"case-sensitivity-windows-linux-and-git","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=1375","title":{"rendered":"Case Sensitivity, Windows, Linux and Git"},"content":{"rendered":"<div style=\"width: 473px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2014\/11\/56bd517718421c5664382287610b2e1c.png\" alt=\"\" width=\"463\" height=\"189\" \/><p class=\"wp-caption-text\">&#8220;It&#8217;s a Madhouse&#8221; for $200, Chuck.<\/p><\/div>\n<p>This is a strange one . . .<\/p>\n<p>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):<\/p>\n<p style=\"padding-left: 30px;\">CALLService.java<br \/>\nCALLServiceImpl.java<\/p>\n<p>to<\/p>\n<p style=\"padding-left: 30px;\">CallService.java<br \/>\nCallServiceImpl.java<\/p>\n<p>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.<\/p>\n<p>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\u00a0code on my own Linux instance, and the build fails. Looking in the code I see this in the Linux version of the project&#8217;s services directory AND I see this out in Stash:<\/p>\n<p style=\"padding-left: 30px;\">CALLService.java<br \/>\nCALLServiceImpl.java<br \/>\nCallService.java<br \/>\nCallServiceImpl.java<\/p>\n<p>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?<\/p>\n<p style=\"padding-left: 30px;\">CallService.java<br \/>\nCallServiceImpl.java<\/p>\n<p>LOL! No sign of the upper case classes! \u00a0It builds too.<\/p>\n<p>My solution &#8212; 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 &#8220;git gc&#8221; cleanup calls and it keeps wanting to delete the Call files I want to keep; gosh. Do I need to re-add, again? \u00a0Ugh. \u00a0 Instead I do another\u00a0git pull &#8211;rebase, and on Windows, finally, it&#8217;s all good, on Linux it&#8217;s all good, and Stash is all good.<\/p>\n<p><em>Side note: I also got the old &#8220;LF will be replaced by CRLF when operating on some files.&#8221; errors from git on some operations. \u00a0I noticed quite a few files were being checked in as ISO-8559 \u00a0from the Linux developers,\u00a0and I\u00a0\u00a0set myself up as UTF-8 on Windows to mesh with them in the first place! \u00a0It&#8217;s a madhouse! \u00a0Won&#8217;t get into it today, but it made for some interesting editor experiences.<\/em><\/p>\n<p><strong>Theories?<\/strong><\/p>\n<p>I tried spiking this out through a GitBlit I had running on my Linux machine. \u00a0I made a project, checked it out, did some case-sensitivity-changes in Windows. \u00a0But I never saw this error on the Linux machine after checking them in. \u00a0I stopped there, and don&#8217;t want to mess with Stash anymore. \u00a0I remember Gitblit has problems with cache cleaning and showing multiple project views of the same project, but this was different.<\/p>\n<p>Windows is notirious for being not-case-sensitive, and Linux is. \u00a0I 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. \u00a0On SVN a rename =\u00a0add + delete. That makes it problematic when the sysadmins are messing with permissions and preventing deletes. \u00a0Maybe our sysadmins stopped my delte permissions for a day. \u00a0 Then\u00a0during this operation the add was executed, but not the drop &#8212; and a Linux Stash server certainly could have seen the case changes as new files.<\/p>\n<p>During checkout, Windows sees the files as the same. \u00a0And some hocus pocus writes over the old names. \u00a0But Linux was never fooled for a second.<\/p>\n<p>I don&#8217;t know. \u00a0I found the problem, I fixed it. In the industry sometimes I can&#8217;t spend three days figuring out something. \u00a0I note it, throw it in the team wiki, make a blog post and move on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23],"tags":[35,49],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1375"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1375"}],"version-history":[{"count":6,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1375\/revisions"}],"predecessor-version":[{"id":1383,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1375\/revisions\/1383"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1375"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}