{"action":"created","issue":{"url":"https://api.github.com/repos/assimp/assimp/issues/611","labels_url":"https://api.github.com/repos/assimp/assimp/issues/611/labels{/name}","comments_url":"https://api.github.com/repos/assimp/assimp/issues/611/comments","events_url":"https://api.github.com/repos/assimp/assimp/issues/611/events","html_url":"https://github.com/assimp/assimp/issues/611","id":95447095,"number":611,"title":"Line endings violate .gitattributes","user":{"login":"danijar","id":2111293,"avatar_url":"https://avatars.githubusercontent.com/u/2111293?v=3","gravatar_id":"","url":"https://api.github.com/users/danijar","html_url":"https://github.com/danijar","followers_url":"https://api.github.com/users/danijar/followers","following_url":"https://api.github.com/users/danijar/following{/other_user}","gists_url":"https://api.github.com/users/danijar/gists{/gist_id}","starred_url":"https://api.github.com/users/danijar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danijar/subscriptions","organizations_url":"https://api.github.com/users/danijar/orgs","repos_url":"https://api.github.com/users/danijar/repos","events_url":"https://api.github.com/users/danijar/events{/privacy}","received_events_url":"https://api.github.com/users/danijar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-16T14:34:54Z","updated_at":"2015-07-28T02:58:14Z","closed_at":null,"body":"According to the `.gitattributes`, source code files should have Unix line endings.\r\n\r\n```\r\n# Declare files that will always have LF line endings on checkout.\r\n*.cpp text eol=lf\r\n*.h text eol=lf\r\n*.c text eol=lf\r\n*.hpp text eol=lf\r\n*.txt text eol=lf\r\n*.cmake text eol=lf\r\n*.sh text eol=lf\r\n```\r\n\r\nWhen we look at the `code` folder, there is only one file with Windows line endings, which is a MinGW file so I think that is okay.\r\n\r\n```bash\r\n$ ls code | wc -l\r\n337\r\n$ egrep -l $'\\r'\\$ code/* | wc -l\r\ngrep: code/BoostWorkaround: Is a directory\r\ngrep: code/res: Is a directory\r\n1\r\n```\r\n\r\nHowever, in the `code/BoostWorkaround/boost/` folder, all of the files have Windows line endings. It seems like they existed before the `.gitattributes` and have never been converted.\r\n\r\n```bash\r\n$ ls code/BoostWorkaround/boost/ | wc -l\r\n15\r\n$ egrep -l $'\\r'\\$ code/BoostWorkaround/boost/* | wc -l\r\ngrep: code/BoostWorkaround/boost/math: Is a directory\r\ngrep: code/BoostWorkaround/boost/tuple: Is a directory\r\n13\r\n```\r\n\r\nThis is a problem, since after cloning the repository on Linux, the whole [working directory is marked as modified][1]. Therefore, you cannot check out a branch or commit. In my own application, I use CMake's `ExternalProject_Add` to automatically clone and build Assimp. This failed due to the whitespace issue.\r\n\r\n```\r\nCloning into 'source'...\r\nerror: Your local changes to the following files would be overwritten by \r\ncheckout:\r\n    code/BoostWorkaround/boost/format.hpp\r\n    code/BoostWorkaround/boost/shared_ptr.hpp\r\n    code/BoostWorkaround/boost/timer.hpp\r\n    contrib/irrXML/irrXML.cpp\r\n    doc/dox.h\r\n    samples/SimpleOpenGL/Sample_SimpleOpenGL.c\r\n    scripts/IFCImporter/entitylist.txt\r\nPlease, commit your changes or stash them before you can switch branches.\r\nAborting\r\nCMake Error at temp/Assimp-gitclone.cmake:49 (message):\r\n  Failed to checkout tag: 'dca3f09'\r\n```\r\n\r\nThis is how the line endings can be converted to Unix style.\r\n\r\n```bash\r\nfind -iregex '.*\\.\\(cpp\\|h\\|c\\|hpp\\|txt\\|cmake\\|sh\\)$' -exec sed -i 's/\\r//' {} \\;\r\n```\r\n\r\nI filed a [pull request that applies this patch][2].\r\n\r\n[1]: http://stackoverflow.com/a/10363472/1079110\r\n[2]: https://github.com/assimp/assimp/pull/612"},"comment":{"url":"https://api.github.com/repos/assimp/assimp/issues/comments/125418199","html_url":"https://github.com/assimp/assimp/issues/611#issuecomment-125418199","issue_url":"https://api.github.com/repos/assimp/assimp/issues/611","id":125418199,"user":{"login":"danijar","id":2111293,"avatar_url":"https://avatars.githubusercontent.com/u/2111293?v=3","gravatar_id":"","url":"https://api.github.com/users/danijar","html_url":"https://github.com/danijar","followers_url":"https://api.github.com/users/danijar/followers","following_url":"https://api.github.com/users/danijar/following{/other_user}","gists_url":"https://api.github.com/users/danijar/gists{/gist_id}","starred_url":"https://api.github.com/users/danijar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danijar/subscriptions","organizations_url":"https://api.github.com/users/danijar/orgs","repos_url":"https://api.github.com/users/danijar/repos","events_url":"https://api.github.com/users/danijar/events{/privacy}","received_events_url":"https://api.github.com/users/danijar/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T02:58:14Z","updated_at":"2015-07-28T02:58:14Z","body":"Thanks, so I might ask @kimkulling. Could you have a look, please?"}}