git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Date
Jun 25, 2010, 08:58 UTC
Message-ID
<EE9F4F92-06D5-4B31-BF6F-1163774C112B@gmail.com>
In-Reply-To
<4C246622.9090707@viscovery.net>
On 25. juni 2010, at 10.17, Johannes Sixt wrote:
Show 13 quoted lines
> Am 6/25/2010 9:58, schrieb Eyvind Bernhardsen:
>> 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.
Such a smudge filter would break when core.eol=lf, but you're suggesting that someone might be using a picky smudge filter and has set core.eol=crlf to make sure it gets the line endings it expects?
That's a very good catch.  I'll add a test so that the optimization is only done if filter is NULL.
-- 
Eyvind Bernhardsen
Previous: Johannes SixtNext: Finn Arne Gangstad
Message 8 of 9 in “Help merging when text has been normalized”
  1. 0/3 Help merging when text has been normalizedEyvind Bernhardsen, Jun 24, 2010
  2. 1/3 Avoid conflicts when merging branches with mixed normalizationEyvind Bernhardsen, Jun 24, 2010
  3. 2/3 Try normalizing files to avoid delete/modify conflicts when mergingEyvind Bernhardsen, Jun 24, 2010
  4. 3/3 Don't expand CRLFs when normalizing text during mergeEyvind Bernhardsen, Jun 24, 2010
  5. Johannes SixtJun 25, 2010
  6. Eyvind BernhardsenJun 25, 2010
  7. Johannes SixtJun 25, 2010
  8. Eyvind BernhardsenJun 25, 2010
  9. Finn Arne GangstadJun 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.