[Bf-committers] Only commit UNIX LF please!

Chris Want cwant at ualberta.ca
Wed Jun 24 22:26:39 CEST 2009


H wrote:
> Ton Roosendaal wrote on 20090624:
> 
>> Reports come in that people are committing DOS line endings.
>> Just set your editor to Unix LF.
>>
>> It's in particle code, texture nodes, UI scripts, ...
> 
> We should first change all line endings to LF (a find/perl one liner),
> then we can use :
> 	svn propset svn:eol-style LF
> on all text files so they stay that way.
> I can do both actions if noone else wants to.
> 
> Then we need a svn commit script that enforces our svn:eol-style on new
> text files.  I have not found a nice way for this yet. Anyone ?
> 
> -- Hans

I should point out that "svn:eol-style native" is probably
safer for Window people. On the server, the text files
get saved with LF endings. When a Windows user checks out,
that LF gets converted to CRLF, they work on the file, and
when they commit the server converts their changes to having
just LF again. For UNIX people, it does no conversion so they
check out as LF, and commit changes back as LF.

GSR has a script now that changes the EOL's to LF, commits,
and sets "svn:eol-style native" on the offending files.

The best thing thought would be to a pre-commit hook on
the server that does this work, and ensures that
"svn:eol-style native" is set on all text file commits
(*.c, *.h, *.py, etc.). The closest thing that Google
finds is this script, which only tells user to set properties
on the file manually:

http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/check-mime-type.pl

Chris



More information about the Bf-committers mailing list