About EOL problems in boost to git conversion

44 views
Skip to first unread message

Johan 't Hart

unread,
Nov 28, 2013, 3:23:19 AM11/28/13
to rypp...@googlegroups.com

Hi all,


Because I don’t know how to post in the boost developers group, I’m posting here because I know that Dave and Daniel are monitoring this group :)


I am somewhat closely following the progress of the git conversion of the boost repository. I read about the problems with EOL conversion and not reaching consensus for how to do it right. And I think I know how to do it right, thats why I wanted to post. :)


There was some talk about the autocrlf configuration option. The thing is, this was an early git solution for line ending conversion on different platforms. It has been superseded with the .gitattributes mechanism with which you are able to overrule this configuration option (even per file). Which this, one can solve the problem the same way subversion does.


I think the basics have to be like this:


- Set the default for the text attribute to auto to ensure native platform EOL style

* text=auto


- By default set the line ending style for every extension:

*.txt           text

*.vcproj        eol=crlf

*.bat        eol=crlf

*.sh            eol=lf

*.jpg           -text

etc.

(-text implies binary)


- When subversion eol setting for a file differs from the default, set the eol style explicitly

foo/bar/test_for_wrong_eol.cpp -text

(Note that this will also fix the files with deliberately wrong line endings that will now be threated as binary regardless of the autocrlf configuration option)


- Files not marked with -text can now be stored with LF line endings in the repository like git natively does. On checkout files should then be binary identical as a subversion checkout.


I hope this will help reaching consensus about how to handle EOL.


Greetings,

Johan


Reply all
Reply to author
Forward
0 new messages