openframeworks/openFrameworks — pull request #2510 by bilderbuchi (2013-08-24 18:03:19+00:00)
Title: Add .gitattributes - don't merge yet

This closes #2120.
I added a gitattributes file to enable the OF repo to consistently deal with line endings, without any settings necessary on the user-side.
I modeled the file on [Github's default suggestions](https://help.github.com/articles/dealing-with-line-endings#per-repository-settings), although I left out the .sln files keeping CRLF everywhere. This shouldn't have an impact on Windows users, as now all files are converted to native line endings on checkout. git repo internal, everything is LF.

This necessitates normalizing the already existing files, otherwise a user just changing a single character in the future would actually touch the whole file. The normalization was done as [recommended by git](http://git-scm.com/docs/gitattributes#_checking-out_and_checking-in). The instructions by Github on their help page did not work correctly for me. The normalization completely replaces/refreshes 122 files in the repo.

The only files not caught by this are two `.inf` files in `./addons/ofxKinect/libs/libfreenect/platform/windows/inf/*/`, which are not recognized as text by git apparently. You can check line endings easily on LF-based platforms via `find . -not -type d -exec file "{}" ";" | grep CRLF`.
This could be amended by adding `*.inf*` files to the explicit text attribute, like for cpp, in .gitattributes, but I'm not sure this is necessary for two files somewhere in an external library folder.
Interestingly, the third `.inf` file in the ` xbox nui camera` folder shows a `data` file type, so something really strange seems to be going on with these files anyway.

cc @kylemcdonald