0

I have the following problem:

Case 1: I checkout a svn repo, open a file with Sublime or gedit or nano and I save it without doing anything. When I do a svn diff on that file a bunch of lines appear as if they were modified. I revert to base.

Case 2: I open the same file with vim or notepad (on wine) save the file without doing any modifications and svn diff is empty as it should.

Has anyone experienced such a behavior? It's really annoying and I can't create a proper patch.

Thanks

Mihai Vinaga
  • 1,059
  • 2
  • 10
  • 27

2 Answers2

3

Possible problem in line endings. Try find in Sublime/gedit option to not convert line endings or every time force save with correct line ending.

Sergey Azarkevich
  • 2,641
  • 2
  • 22
  • 38
  • Nope doesn't seam to fix it. The thing is that for some files it does this and for others it does not, I have checked svn props and found noting there. Here is a sample code of how it looks: `- if (!is_null($row['fh_delete'])){ - $v = $row['fh_delete']; + if (!is_null($row['fh_delete'])){ + $v = $row['fh_delete']; }` Also checked to see that there are no trailing spaces – Mihai Vinaga Mar 19 '14 at 10:37
  • You were right, the problem was with line endings. The only thing is that I don't know of a setting which makes sublime to leave line endings alone – Mihai Vinaga Apr 08 '14 at 14:00
1

Open your user preferences (Preferences -> Settings-User) and add the following option:

"atomic_save": false

Please see this question and my answer below for a full explanation of what atomic saving is, and how it can interfere with a number of external programs, including (I suppose) version control systems like Subversion. Essentially, when "atomic_save" is true (the default in Sublime Text 3), saving a file creates some temp files, deletes the original file, then renames a temp file to the original's name. SVN is probably picking this up, and is showing the whole file as changed, when in fact you haven't done anything to it.

Community
  • 1
  • 1
MattDMo
  • 100,794
  • 21
  • 241
  • 231