File Name Case Sensitivity and SVN

Posted by | July 07, 2011 | Magento, Web Development | 2 Comments

Last week I tried to add the media folder of a large catalog Magento website. Initially everything worked well, however eventually I started having severe issues on my local development environment. The issue is largely related to the File Name Case Sensitivity within SVN and how file names behave differently between Linux and Windows. I am just sharing my observation and I do not have a complete answer to this issue as of yet, maybe you can help here…

What happens is that under the media folder, actually /media/catalog/product/ to be exact, Magento stores all product image files and files them according to the first and second letter of the file name. So, the file name football.gif for example will be under ./f/o/football.gif and the file tennis.gif will be filed under ./t/e/tennis.gif, etc. While this works great under Linux and can easily be stored in SVN with a simple SVN add and SVN Commit, it does not work for Windows based environment.

The reason it does not work on Windows is because in Windows, filenames and folder names are case insensitive, hence /media/catalog/product/a will collide with the folder /media/catalog/product/A (notice one is upper case and one is lower case). This is extremely frustrating as it means that I must ignore the media/catalog/product folder completely if I want to develop on Windows and deploy on Linux.

Another option I just found is to disable the case sensitivity in my SVN repo, but still I do not know how this will translate into real life scenario as I did not try it.

Aside from sticking to all linux dev environment or ignoring the entire /media/catalog/product folders, how are you handling this issue?

2 Comments

  • Sean says:

    Magento’s native environment is Linux. If you are planning on running your e-commerce system on a Linux server, you will find that many of the obstacles to having it run smoothly can be addressed in the development phase instead of having it be a monumental surprise when you decide to finally go live and your customer is fantastically less than impressed that you are now running into problems causing financial and customer relations grief instead of finding, fixing and overcoming them six months ago in your own domain. Airing dirty laundry has killed many a Magento Dev’s career. Magento was developed on a case sensitive file system, all attempts at trying to make Windows development do this waste valuable time. It costs you as a developer little to have a good quad core system running a Linux virtual server to make things really work. You can have it all, Windows development tools and a Magento native server OS ALL ON ONE MACHINE.

  • Ron Peled says:

    Hey Sean,
    Great feedback, and true. I rarely see any issues with Magento while developing and debugging it on my windows machine. This is perhaps one of those oddities that are more visible if you actually work interchangeably between OS types and use SVN heavily like I do. Your advise of addressing issues early by using an environment that is as close to the deployment environment is pure gold. I should probably do a short video on how I have my environment setup: dev, staging, and live. I’m always curious on how other people have their environments setup, let me know…