Re: Why doesn't git core.eol=lf work?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason Cho <jason11choca@xxxxxxxxx> write:
> 
>> 
>> Since you posted `git diff` output, may I ask if your concern is
>> actually the ^M in the diff output, which you intend to fix with
>> automatic CRLF-to-LF conversion?
>> 
> 
> No, my intent is to find moved or duplicated text among files. 
> 
> Let's say license_header.txt has 
> 
> DBeaver - Universal Database Manager^M
> Copyright (C) 2010-2018 Serge Rider (serge@xxxxxxxxx)
> 
> and another.txt has
> 
> DBeaver - Universal Database Manager
> Copyright (C) 2010-2018 Serge Rider (serge@xxxxxxxxx)
> 
> My tool doesn't think the two pieces of txt the same because of ^M.
> 
> Although my tool can do normalization internally, if git checks out files to CRLF due to core.autocrlf=true, my tool is fighting against git. git shouldn't spend time converting to CRLF which is about to be converted back to LF by my tool.
> 
> That's why I set core.autocrlf=false, and ask git to normalize files to LF.
> 
> So the problem is that, conversion to LF is not happening.

I believe that it's impossible to check out CRLF from the index as LF.
You have to use your tool to do that.

The definition of core.eol=lf is here:
  https://git-scm.com/docs/gitattributes/2.9.5#:~:text=Set,-to%20string%20value%20%22lf

This means that when you use git add to stage files, Git will convert
CRLF line endings to LF. However, when you check out files, Git will
leave the line endings unchanged.

Thanks,
Lidong




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux