1

I'm using CentOS Linux 5.8 as a web server and tortoise SVN for synchronizing version of our code. We write the code in Windows 7 professional 64BIT with NetBeans and NotePad++.

I'm committing the code files (.php) from the Linux Shell by this command:

svn co svnFolder serverFolder --username **** --password ****

The problem is, after committing the files, when I'm opening them directly from the server (for debugging) by NotePad++ (I'm doing View/Edit from Filezilla) I have extra blank lines.

A code that looks like this on the localhost (On NotePad++):

private $producer;
private $account;
private $admin;

private $producerEvents;
private $accountProducers;
private $adminAccounts;

Will look like this after committing to the server (Again, on NotePad++):

private $producer;

private $account;

private $admin;



private $producerEvents;

private $accountProducers;

private $adminAccounts;

If I upload files by FTP, No blank lines are being added.

How can I solve it ? Thanks.

1
  • 2
    By the sounds of it, your line-endings are being confused. What line-ending setting are you using in Notepad++?
    – Jay
    Jun 10, 2012 at 12:34

1 Answer 1

2

You're committing the files with CRLF endings from the Windows system - which will generally cause no problems, but it's a bit 'abnormal' on your Linux system. Text editors won't normal display the double-space like that - I suspect that's because of the access method via Filezilla.

Since your files are being accessed by systems with both line ending types, the best approach would be to have SVN enforce the line ending style.

Use TortoiseSVN's property editor on the files (or in recursive mode, on a directory) that you're working with. Add the svn:eol-style property.

  • Set it to LF if you want the Linux-style LF endings to be used everywhere (Notepad++ will work just fine with this, but if you open the file in something like notepad.exe, it'll think it's all one line),
  • or set it to native, which will cause the checked-out copies on each system to have their native line ending style.

The property is set on individual files, so make sure you add the property to any new files that are created after you put the property in place.

1
  • Thanks for the help, I will check it on the next check-out and report back...
    – Alon Adler
    Jun 10, 2012 at 20:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .