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