Re: Why doesn't git core.eol=lf work?
- From
- Jason Cho <jason11choca@proton.me>
- Date
- Jul 12, 2025, 19:15 UTC
- Message-ID
- <sAxC2ASixUyCVtsk22zrxI2vAeM546T7O2tyWIS2vv_TGFo2OXWegg8J_r0zGzo5bZOA-BrwHa5yjAv2-Ewusjv9Fa9YYocrRkaIfpxhv_c=@proton.me>
- In-Reply-To
- <23f2bbea-1294-4773-89d8-b270e2c3bb52@kdbg.org>
Show 5 quoted lines
> > 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@jkiss.org)
and another.txt has
DBeaver - Universal Database Manager Copyright (C) 2010-2018 Serge Rider (serge@jkiss.org)
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.