mysociety / caps

A simple, open database of local government climate action plan documents and emissions data.
https://cape.mysociety.org
Other
8 stars 2 forks source link

Do we really need a .gitattributes file for special handling of line endings? #112

Open zarino opened 3 years ago

zarino commented 3 years ago

We’ve had this .gitattributes file since day one – probably because this project grew out of boilerplate from previous mySociety django projects that involved Windows developers.

But the line ending stuff leads to odd surprises when you check in a new type of file. For example, here was me checking in a few jpg files earlier:

~/Work/mySociety/caps ⌘ git commit -am 'Fix broken team avatar images on interstitial modal'
warning: CRLF will be replaced by LF in caps/static/img/avatar-grace.jpg.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in caps/static/img/avatar-isaac.jpg.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in caps/static/img/avatar-zarino.jpg.
The file will have its original line endings in your working directory
[master 886d8c7] Fix broken team avatar images on interstitial modal
 2 files changed, 0 insertions(+), 0 deletions(-)
 rewrite caps/static/img/avatar-grace.jpg (95%)
 rewrite caps/static/img/avatar-isaac.jpg (82%)

It’s been suggested that maybe * text eol=lf isn’t the best way to achieve what we’re after. Or maybe we don’t need the file at all any more.

@ajparsons (as our resident Windows developer!) and @struan to discuss.

ajparsons commented 3 years ago

I always work inside docker now and so have many fewer windows specific issues, I don't think I need this fix any more.