How should I Fix "svn: Inconsistent line ending style"?

Viewed 82757

When I run "svn propedit svn:ignore ." at the root of my svn repository, I get this error: svn: Inconsistent line ending style

I have tried to run this script: http://blog.eflow.org/archives/130 which runs dos2unix and sets the eol-style on all of the files, however this problem still persists. Any idea what could be wrong?

21 Answers

Subversion is not complaining about the content of any file, but about the content of the svn:ignore property. One way to fix this is to simply delete the svn:ignore property with svn propdel and then recreate it.

Another way which may be easier if you have a lot of lines in your svn:ignore:

  1. fetch the value of svn:ignore in a temporary file like this:

    svn propget svn:ignore . > temp

  2. fix the line endings in the temp file
  3. set the value of svn:ignore from the fixed file like this:

    svn propset svn:ignore -F temp .

My problem was that I was getting this in Visual Studio.NET. To fix it, I copied all the text of the file into notepad and saved it from Notepad to "xxx.aspx" or whatever the proper file name is. Then in Visual Studio, I was prompted to reload a changed file, and voila - a dialog box asking me if I would like to normalize my line endings. Problem solved.

Did the script definitely touch each and every text file (assuming you do have dos2unix installed, otherwise that'd be why...)?

The other things I can think of is to check that all files have their mime-type set correctly (you don't have a binary file that's somehow marked as a text file checked in, perchance?).

That said, if you are in a multi-OS environment I consider it not a good idea to set svn:eol-style to CRLF as described in the blog post above if you are sharing and editing text files between OSs. Because if you do it that way, the files that look OK in Windows are littered with control characters in Unix. Better to use 'native' as the EOL style.

vi didn't show me the bad line so i removed the end of lines from the comment section, readded them (up to END) and saved the file. it worked after that.

NOTE: backup you revprop file before tweaking it. if you turf it, no going back

If you get it while doing the propedit, then it seems to me more that SVN is complaining about the format of the text file you're using for the properties!

Which OS are you on? Which editor are you using to propedit? If the propedit command still fires up an editor, I would use this editor to check which line endings are in there (vi does this IIRC).

As 'Marius Matioc' suggested in above, would be easy and quick fix 1.Open file in Notepad++ 2.Edit menu -> EOL Conversion -> Unix 3.Save 4.Edit menu -> EOL Conversion -> Windows 5.Save

For me the Problem was that the encoding was UTF-16 BE BOM. I had to convert it to UTF-8 BOM using Notepad++ (Encoding -> Convert To UTF-8 BOM).

Related