fjcapelo / jquery-csv

Automatically exported from code.google.com/p/jquery-csv
MIT License
0 stars 0 forks source link

Fix for CRLF issue when working repo on linux/mac #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

i forked and checked out the project on my mac and it went a bit crazy with the 
crlf line endings...

To fix that i had to create a .gitattributes file, here's the commit:
https://code.google.com/r/thanpolas-jquery-csv/source/detail?r=733b531727e169a10
cd8743a78b5485d7d80466b&name=gitattributes-crlf-fix

Original issue reported on code.google.com by Thanpolas on 29 Oct 2012 at 10:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
What's the big deal? Line endings are nothing but window dressing anyway... The 
code works fine without them and we're not fancy enough to use carriage returns 
here? /s

I'm kidding. It's probably jumbling the code for you because all of the 
development on jquery-csv happens in linux (which uses lf not crlf). I'm also 
using Notepad++ (via WINE) so it should be trivial to batch convert everything 
to crlf.

I'll let you know as soon as the source is ready.

Original comment by evanpla...@gmail.com on 30 Oct 2012 at 4:02

GoogleCodeExporter commented 9 years ago
Actually my issue is with git, not my ide...

I have my git configured so as to convert crlf to lf, which is the default 
setting on most unix based machines.

This causes each checkout, to have uncommitted changes by default.

Adding the ".gitattributes" file, fixes that.

However, yea it would be a good idea to convert all to LF

Original comment by Thanpolas on 30 Oct 2012 at 6:19

GoogleCodeExporter commented 9 years ago
Go figure. I made the switch to Notepad++ on linux because I'm not a vim/emacs 
monkey and all the rest of the editors suck. As a result, half of the project 
files use CRLF, the other half use LF.

The project-wide convention is LF. I had to add an additional line-conversion 
commit to the repo but everything should be consistent now.

Quick question, you're saying the following setting sets all line endings to lf 
on commit? 

# Set default behaviour, in case users don't have core.autocrlf set.
* text=crlf 

Original comment by evanpla...@gmail.com on 30 Oct 2012 at 11:58

GoogleCodeExporter commented 9 years ago
The .gitattributes file helps ignore the crlf issue.

If you want it to force normalization then it's better you see this article:
http://git-scm.com/book/en/Customizing-Git-Git-Configuration#Formatting-and-Whit
espace

Original comment by Thanpolas on 31 Oct 2012 at 9:16

GoogleCodeExporter commented 9 years ago
OK, thanks for clarifying.

I'll add the .gitattributes to ensure that I don't accidentally add crlf to any 
documents I create in the future (as git should notify where any 
inconsistencies occur).

I'd like to say that this is an uncommon issue but it's not the first time I 
have encountered it. At least, now I have a workable solution.

Thank you for the feedback.

Original comment by evanpla...@gmail.com on 1 Nov 2012 at 5:54

GoogleCodeExporter commented 9 years ago

Original comment by evanpla...@gmail.com on 1 Nov 2012 at 5:54

GoogleCodeExporter commented 9 years ago

Original comment by evanpla...@gmail.com on 4 Nov 2012 at 11:03