LF versus CR-LF line endings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

LF versus CR-LF line endings

Gnomad
Just a community service message:  Please take care to check that lines are ended in a line-feed (LF) character only, before transferring edited files across to your Shield.  

Yesterday, I did not.  By default, github's download to Windows gave me CR-LF endings, which semi-bricked my Shield until I could manually fix things via console cable..  Best part of a day lost

I've added a .gitattributes file to our GitHub repository which should prevent people encountering the same problem downloading from there in future.  But if you've already got a local repository, probably worth clearing your cache and re-downloading to ensure you don't have any old CR-LF files lying around:
git rm --cached -r .
git reset --hard
For a discussion on the issue, see here.

Notepad++ is a good tool for editing files on Windows. It has a toolbar button that makes CR and LF characters visible, and it's text replace dialog allows you to strip the CRs.  See this page for more info.
OpenWrt SNAPSHOT, r10391-3d8d528939
Reply | Threaded
Open this post in threaded view
|

Re: LF versus CR-LF line endings

Roadrunnere42
Hi Gnomod

I found out the hard way like yourself that when using winscp under wine in linux to copy files over from my linux computer to the Shield, would randomly change the line ending to CR-LF which would stop the scripts working.

How does the .gitattributes file  file work?

roadrunnere42
Reply | Threaded
Open this post in threaded view
|

Re: LF versus CR-LF line endings

breda
Hi, Roadrunnere42 wanted to confirm do I  have to install V8.1 first or can I update right to v8.2?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: LF versus CR-LF line endings

Roadrunnere42
Hi breda

I'm just about to release 8.3 which has just some syntax error corrections

I will include all files from 8.1 and 8.2 so to stop any confusion.


roadrunnere42
Reply | Threaded
Open this post in threaded view
|

Re: LF versus CR-LF line endings

breda
Thanks Roadrunnere42 I will wait for the v8.3 thanks for all the hard work
Reply | Threaded
Open this post in threaded view
|

Re: LF versus CR-LF line endings

Gnomad
In reply to this post by Roadrunnere42
The values in the .gitattributes file just make sure that whatever is uploaded or downloaded from github is converted to use LF for line-endings - irrespective of the defaults your OS or editing software may apply.  I've not seen that WinSCP has changed line endings on me, so I'll keep an eye out for that, cheers.
OpenWrt SNAPSHOT, r10391-3d8d528939