File Comparison to not take into account line endings?

Hello everyone.


I work across windows and unix-based systems on a daily basis so I'm always coming across line ending issues in my files. I regularly synchronise my local copy (on windows) against my remote copy (unix server) and when doing so, the file comparison popup in PhpStorm brings up a whole bunch of files which supposedly have differences. However, the only difference that most files have is the line endings (CRLF on my local copy and LF on the remote unix server copy) and no actual difference in the actual main content.

So I was wondering if there is any way to tell the IDE to not compare the line endings during file comparison and synchronisation? Because it can get really tiring sifting through 100s of files when synchronising content across development platforms.


Best regards

5 comments

Hi there,

Have you though about actually bringing line endings to single style on both local and remote? PHP on Windows works fine with Unix style line endings. Latest version of PhpStorm (6.0.1) can operate with line endings (you can convert file by file .. or whole folder /multiple files at once (when doing whole folder make sure that it has only text files .. and currently it can corrupt binary files))

As for comparing -- when 2 identical files are the same except line ending, the IDE will notice that fact on Difference/Comparison screen (you should see line endings on top, in the center). Don't know if it can be turned off (cannot find such settings myself)

0

Bazzik wrote:

Hi there,

Have you though about actually bringing line endings to single style on both local and remote?

Yes, but that's not a proper solution when you're constantly downloading and uploading, for example, framework updates and patches. I would much rather see a proper filter or option in the file comparison view of the synchronisation window that let's me filter out any listings that are solely based on line differences. You are correct in saying that the editor shows that the files only have line differences, but the editor still lists these files, and if there's a good few of them (100+), it can get quite tedious to sift through all of them to see which files have actual differences in their contents.

0

Hello, Mohammed!

How do you download and upload those files? I mean they should remain their line endings during that process. Do you patch them afterwards?

0

Hello Elena.


I mostly use the built-in FTP server or Filezilla (which seems to convert line endings on shared unix hosts for some unknown reason). For example, a few days ago I downloaded the Laravel framework from Github. I installed my local instance and then uploaded the files to my remote host through Filezilla. Then I opened up phpstorm, made a few changes on some files, and decided to sync my local copy with the remote webhost to see what needs uploading. Lo and behold! The synchronisation windows brought up *ALL* the files as having differences, even though 99% of them only had differences in line endings. So this is a bit of an issue for me. It would be super awesome if there was some option to disable comparison of line endings.

0

Thanks. I've created an issue for that, feel free to watch and vote.

0

Please sign in to leave a comment.