threads / discuss / 27031

convert crlf to eol on vendor branch overlay

Subject: convert crlf to eol on vendor branch overlay

## tl;dr

3 messages between Apr 8, 2011 and Apr 8, 2011.

replies: 2people: 3as markdown or json

Neal Kreitzinger· Apr 8, 2011, 02:40 UTC · lore

My vendor gave me a tarball with all CRLF eol's. I'm using the vendor-branch overlay method (git ls-files -z | xargs -0 rm -f && tar -xvzf tarfile.tar.gz). How do I convert the eol's to LF?

I tried this:

vi .git/attributes SRC/*/* text (convert these to LF eol on commit)

$ git config core.eol lf (convert "text" attr files to LF eol on checkout)

$ git add . -A $ git commit -m'convert eol' (should convert CRLF to LF) $ git checkout otherbranch (change worktree) $ git checkout vendorbranch (checkout worktree from commit to get LF version) $ git reset HEAD^ (remove commit but keep worktree LF version) $ git diff (still CRLF) $ git status (still show everything as modified due to CRLF)

v/r, neal

Junio C Hamano· Apr 8, 2011, 04:43 UTC · re: Neal Kreitzinger · lore

Re: convert crlf to eol on vendor branch overlay

"Neal Kreitzinger" <neal@rsss.com> writes:
Show 8 quoted lines
> How do I convert the eol's to LF?
>
> I tried this:
>
> vi .git/attributes
> SRC/*/* text  (convert these to LF eol on commit)
>
> $ git config core.eol lf (convert "text" attr files to LF eol on checkout)
Instead, how about something like:
  $ git ls-files -z | xargs -0 perl -p -i -e 's/\r$//'
and then:
> $ git add . -A
> $ git commit -m'convert eol'  (should convert CRLF to LF)
?
Neal Kreitzinger· Apr 8, 2011, 18:18 UTC · re: Junio C Hamano · lore

Re: convert crlf to eol on vendor branch overlay

On 4/7/2011 11:43 PM, Junio C Hamano wrote:
Show 21 quoted lines
> "Neal Kreitzinger"<neal@rsss.com>  writes:
>
>> How do I convert the eol's to LF?
>>
>> I tried this:
>>
>> vi .git/attributes
>> SRC/*/* text  (convert these to LF eol on commit)
>>
>> $ git config core.eol lf (convert "text" attr files to LF eol on checkout)
>
> Instead, how about something like:
>
>    $ git ls-files -z | xargs -0 perl -p -i -e 's/\r$//'
>
> and then:
>
>> $ git add . -A
>> $ git commit -m'convert eol'  (should convert CRLF to LF)
>
> ?
That worked!  Thanks!

← back to recent threads