Subject: Re: [PATCH v3 3/3] Don't expand CRLFs when normalizing text during merge

From: Johannes Sixt <[email-masked]>
Date: Fri, 25 Jun 2010 10:17:38 +0200

Am 6/25/2010 9:58, schrieb Eyvind Bernhardsen:
> On 25. juni 2010, at 07.45, Johannes Sixt wrote:
> 
>> Am 6/24/2010 22:44, schrieb Eyvind Bernhardsen:
>>> There's no need to expand CRLFs when convert_to_working_tree() is called
>>> to normalize text for a merge since the text will be converted back
>>> immediately.  Improves performance of merges with conflicting line
>>> endings when core.eol=crlf or core.autocrlf=true.
>>
>> Pardon me, first you make a big deal about normalization for merges, only
>> that you finally omit it? What am I missing?
> 
> Sorry, I didn't explain that very well.  I noticed that normalize_buffer()
> does more work when core.eol=crlf than it does when core.eol=lf:
> _to_working_tree() converts LF to CRLF, and then _to_git() reverses that
> conversion.  This patch makes normalization act the same way when
> core.eol=crlf as it does when core.eol=lf.

Got it: I missed that you are omitting the conversion only on the "way
out" but not on the "way back".

Looking more closely at your patch, I think that you should make this
optimization only if you can prove that the subsequent apply_filter() is a
no-op. Otherwise, you may break a smudge filter that expects CRLFs.

-- Hannes