{"thread":{"id":"27031","subject":"convert crlf to eol on vendor branch overlay","startedAt":"2011-04-08T02:40:29Z","lastAt":"2011-04-08T18:18:41Z","messageCount":3,"participants":["Neal Kreitzinger","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"165393","messageId":"inlsit$scv$1@dough.gmane.org","threadId":"27031","inReplyTo":null,"subject":"convert crlf to eol on vendor branch overlay","fromName":"Neal Kreitzinger","fromEmail":"neal@rsss.com","sentAt":"2011-04-08T02:40:29Z","receivedAt":"2011-04-08T02:40:29Z","isPatch":false,"sender":{"key":"neal@rsss.com","avatar":null},"body":"My vendor gave me a tarball with all CRLF eol's.  I'm using the \nvendor-branch overlay method (git ls-files -z | xargs -0 rm -f && tar -xvzf \ntarfile.tar.gz).  How do I convert the eol's to LF?\n\nI tried this:\n\nvi .git/attributes\nSRC/*/* text  (convert these to LF eol on commit)\n\n$ git config core.eol lf (convert \"text\" attr files to LF eol on checkout)\n\n$ git add . -A\n$ git commit -m'convert eol'  (should convert CRLF to LF)\n$ git checkout otherbranch  (change worktree)\n$ git checkout vendorbranch (checkout worktree from commit to get LF \nversion)\n$ git reset HEAD^  (remove commit but keep worktree LF version)\n$ git diff (still CRLF)\n$ git status (still show everything as modified due to CRLF)\n\nv/r,\nneal \n"},{"id":"165397","messageId":"7vy63l4ak6.fsf@alter.siamese.dyndns.org","threadId":"27031","inReplyTo":"inlsit$scv$1@dough.gmane.org","subject":"Re: convert crlf to eol on vendor branch overlay","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-04-08T04:43:53Z","receivedAt":"2011-04-08T04:43:53Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Neal Kreitzinger\" <neal@rsss.com> writes:\n\n> How do I convert the eol's to LF?\n>\n> I tried this:\n>\n> vi .git/attributes\n> SRC/*/* text  (convert these to LF eol on commit)\n>\n> $ git config core.eol lf (convert \"text\" attr files to LF eol on checkout)\n\nInstead, how about something like:\n\n  $ git ls-files -z | xargs -0 perl -p -i -e 's/\\r$//'\n\nand then:\n\n> $ git add . -A\n> $ git commit -m'convert eol'  (should convert CRLF to LF)\n\n?\n"},{"id":"165434","messageId":"4D9F5181.7050806@gmail.com","threadId":"27031","inReplyTo":"7vy63l4ak6.fsf@alter.siamese.dyndns.org","subject":"Re: convert crlf to eol on vendor branch overlay","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-04-08T18:18:41Z","receivedAt":"2011-04-08T18:18:41Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 4/7/2011 11:43 PM, Junio C Hamano wrote:\n> \"Neal Kreitzinger\"<neal@rsss.com>  writes:\n>\n>> How do I convert the eol's to LF?\n>>\n>> I tried this:\n>>\n>> vi .git/attributes\n>> SRC/*/* text  (convert these to LF eol on commit)\n>>\n>> $ git config core.eol lf (convert \"text\" attr files to LF eol on checkout)\n>\n> Instead, how about something like:\n>\n>    $ git ls-files -z | xargs -0 perl -p -i -e 's/\\r$//'\n>\n> and then:\n>\n>> $ git add . -A\n>> $ git commit -m'convert eol'  (should convert CRLF to LF)\n>\n> ?\nThat worked!  Thanks!\n"}]}