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

Re: [PATCH 5/8] rerere: use ll_merge() instead of using xdl_merge()

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 17, 2010, 11:52 UTC
Message-ID
<201001171252.38826.j6t@kdbg.org>
In-Reply-To
<1263721144-18605-6-git-send-email-gitster@pobox.com>
On Sonntag, 17. Januar 2010, Junio C Hamano wrote:
> This allows us to pay attention to the attribute settings and custom
> merge driver the user sets up.

I do not think that this change is necessary; I even think that it is wrong, in particular, custom merge drivers should *not* be used anymore.

The code path is about merging the changes between preimage and postimage into a file that has conflict markers (thisimage). At the time when this happens, all three images have already been processed by the custom merge driver.

Consider this preimage:

<foo><bar> <<<<<<< </bar> ======= <baz> text </baz></bar>

>>>>>>>

<more text="here" /> </foo>

and a custom XML merge driver. With your change, you expect that the merge driver knows how to treat syntactically incorrect XML (the "<<<<<<<" and ">>>>>>>").

Of course, without this change, we do expect that the postimage has practically everything outside the conflict markers unchanged[*], otherwise the ll_merge() will fail.

But so would a custom XML driver that does not know how to read conflict markers.

[*] Which is perhaps an assumption that is easily violated. For example, the XML editor used to resolve the conflict could have inserted line-breaks at completely different spots than in the conflicted preimage.

-- Hannes
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 13 in “Rescuing repeated merge of Documentation/git-merge.txt”
  1. 0/8 Rescuing repeated merge of Documentation/git-merge.txtJunio C Hamano, Jan 17, 2010
  2. 1/8 git_attr(): fix function signatureJunio C Hamano, Jan 17, 2010
  3. 2/8 xdl_merge(): introduce xmparam_t for merge specific parametersJunio C Hamano, Jan 17, 2010
  4. 3/8 xdl_merge(): allow passing down marker_size in xmparam_tJunio C Hamano, Jan 17, 2010
  5. 4/8 merge-tree: use ll_merge() not xdl_merge()Junio C Hamano, Jan 17, 2010
  6. 5/8 rerere: use ll_merge() instead of using xdl_merge()Junio C Hamano, Jan 17, 2010
  7. Johannes SixtJan 17, 2010
  8. Junio C HamanoJan 17, 2010
  9. Johannes SixtJan 17, 2010
  10. 6/8 conflict-marker-size: new attributeJunio C Hamano, Jan 17, 2010
  11. 7/8 rerere: prepare for customizable conflict marker lengthJunio C Hamano, Jan 17, 2010
  12. 8/8 rerere: honor conflict-marker-size attributeJunio C Hamano, Jan 17, 2010
  13. Junio C HamanoJan 17, 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.