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

[PATCH v3 0/3] Help merging when text has been normalized

From
Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Date
Jun 24, 2010, 20:44 UTC
Message-ID
<cover.1277408598.git.eyvind.bernhardsen@gmail.com>

Here's a slightly expanded series based on my ll-merge normalization patch. I've been working in a repository that uses "* text=auto" at $dayjob, and this series helps a lot when merging older, pre-normalization branches.

The first commit is a cleaned-up version of the previous patch. I borrowed Finn Arne's explanation for why it's useful for my commit message, ASCII art and all. The idea is pretty simple: normalization might differ between branches, so renormalization is required to prevent (or at least reduce) conflicts.

The second fixes a similar problem, but for delete/modify conflicts. If a file is normalized on a branch but deleted in another, merging the branches will cause a conflict even though the actual content of the file hasn't changed at all.

If the merge-base version of the file and the modified file differ they are both normalized, and if either was changed by normalization they are compared. If they compare equal, the file is considered unmodified and is deleted.

The third patch prevents normalization from expanding and then collapsing CRLFs, saving time and memory when core.autocrlf=true or core.eol=crlf.

- Eyvind
Eyvind Bernhardsen (3):
  Avoid conflicts when merging branches with mixed normalization
  Try normalizing files to avoid delete/modify conflicts when merging
  Don't expand CRLFs when normalizing text during merge
 cache.h                    |    1 +
 convert.c                  |   27 ++++++++++++++++----
 ll-merge.c                 |   12 +++++++++
 merge-recursive.c          |   42 ++++++++++++++++++++++++++++++-
 t/t6038-merge-text-auto.sh |   58 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 133 insertions(+), 7 deletions(-)
 create mode 100755 t/t6038-merge-text-auto.sh
-- 
1.7.1.575.g383de
Next: Eyvind Bernhardsen
Message 1 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.