Jump to content

CR LF and automatic properties: svn:eol-style


Recommended Posts

I've had a problem applying this patch here:

http://www.wildfireg...l=&fromsearch=1

It failed to patch "utility_functions.js" without giving me any hint about the reason.

I finally found out that it's caused by the CR LF line endings of that file. After converting the file to LF line endings the patch applied successfully.

SVN has a property called svn:eol-style which can be set to native.

This means you get LF line endings on a Unix System and CR LF on a Windows system and it should work on both systems.

This has been done manually for some files in the past:

http://trac.wildfire...cket=on&wiki=on

I think doing it manually is not optimal because people will forget to do it most of the time. However it's possible to configure subversion to do it automatically for files matching a certain pattern (e.g. ending with .xml, .cpp, .h, .js etc...).

http://svnbook.red-b...nced.props.auto

Has this ever been considered? I don't have much experience with svn properties, but I think that seems to be a good idea.

Link to comment
Share on other sites

No answer. Does that mean that nobody with access to the svn config has seen this or did you just not have time to look into it/ didn't prioritize it?

Or maybe you don't agree?

It's definitely nothing urgent, but it would help to save some time if it works as expected. :)

Link to comment
Share on other sites

Don't know whether you already spoke with Philip, but I just stumbled upon this reading old logs (this one to be more precise: 2012-05-24-QuakeNet-%230ad-dev.log):

13:03 <@Philip`> historicbruno: Git doesn't have per-file properties - it has a global attributes thing that defines e.g. "*.cpp text=auto" and if you've set the config variable core.autocrlf=true then it'll auto-convert those text files from LF to/from CRLF

13:04 <@Philip`> (I suppose we really ought to disable the svn:eol-style=native for everything in binaries/data/, because that'll break any kind of file-consistency checksum comparison thing we might implement in the future)

13:05 <@Philip`> (but I suppose stuff in source/ should still become CRLF on Windows to make text editors happier)

13:08 <@Philip`> I get messages like "warning: LF will be replaced by CRLF in binaries/.../special/grid_subdiv.xml" and special/textures.xml when doing a diff on some local Git branch, and I have no idea what caused that

13:08 <@Philip`> (and the diff says every line of those files changed)

13:09 <@Philip`> Maybe your thing is a similar problem but it affects random subsets of files, though I have no idea why and that'd seem unusually bizarre

And if you already spoke with him or will in future, please post results here, so this topic will not have such uncertain end.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...