Add code for computing which line-ending to use based on configuration
The implementation is based in my interpretation of several sources of documentation:
- man gitconfig for core.eol and core.autocrlf
- man gitattributes for line-ending conversion
- https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/
It doesn't support gitattributes overriding, it should be easy enough to add
the logic in the functions introduced in the next commit.