Question

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?

Was it helpful?

Solution

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 .

OTHER TIPS

In my case, svn:eol-style property was set on a file. And "some lines of the file were separated by UNIX line endings (LF character), while others were separated by DOS-style line endings (CR+LF characters)". Here is another detailed discussion of this problem.
"Edit"->"EOL Conversion"->"Windows format" in Notepad++ solved the issue for me.

In my case I was editing in Windows. To fix:

  1. Open file in Notepad++
  2. Convert line ending to Unix (Edit menu -> EOL Conversion -> Unix)
  3. Save
  4. Convert line endings to Windows (Edit menu -> EOL Conversion -> Windows)
  5. Save

This did it.

Running

unix2dos [file]

via cygwin fixed this for me.

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.

If it only happens with one or two files, you can also open the file, copy and paste the content to a new file (with a normal text editor), and save it. This file can then be added (rename or move to make it the correct name).

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.

I got this error, but it ended up being a file missing the last End-of-lie( incomplete last line).

Correcting this by opening the file in VI and saving it solved it.

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).

This bothered me for so long, working an a multi-system team with SVN. I made this useful app, that navigates a folder with sub-folders looking for text files and converts all UNIX EOL to DOS EOL. It is an AIR app, works on both Windows and Mac. hope it helps

http://www.pippoflash.com/index.php/2012/06/11/svn-error-inconsistent-line-ending-style-nightmare-solved-download-app/

Filippo

For mac osx, I got this error for a file and had to convert it using dos2mac and then mac2unix. Once I did that it fixed the issue for the line endings complaining.

The problem occurred for me after some modifications in several text files was made such that only \n were added to seperate certain lines, whereas normally \r\n terminate every line. So, the fix was to use Notepad++ to find ([^\r])\n and replace with $1\r\n. This way the end of line characters were consistent everywhere.

To consistently convert Windows to UNIX line endings using perl(1):

perl -p -i.bak -e 's#\r\n#\n#go' my-file.txt

To convert from UNIX back to Windows:

perl -p -i.bak -e 's#\n#\r\n#go' my-file.txt

I had the same problem when running javadoc via an ant task on a Windows machine.

I fixed it by adding <fixcrlf srcdir="${dir.javadoc}" eol="dos"/> below the javadoc ant task.

I had a same problem in a archive that was working well before. In notepad++, i've chosen convert format to UTF-8. This worked for me.

I got the same error message when trying to svn propset eol-style:native a PHP file in emacs, so hopefully this will help someone out who reaches this question.

I had something like the following:

str_replace('</li>^M<br>', '</li>', $text);

Where ^M is a single character (caret escape for carriage return).

The fix was to change that line to the equivalent:

str_replace("</li>\r<br>", '</li>', $text);

Note the double quotes instead of single quotes!

In my case the error occurred because the file had the encoding "UCS-2 LE BOM". The files with ANSI were ok. I checked the line endings, in all files they were correct. It seems that (at least in my SVN version) wide char files are sometimes not recognized properly.

The simplest solution is it to remove the "svn:eol-style" property.

In NetBeans you can use the "Show and change line endings" plugin.

After installing it and restarting NetBeans, the line ending style is shown at the right side of the status bar. You can click it and select the ending you want to convert the file to.

NetBeans Show and change line endings plugin

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top