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

using xdl_merge(), was Re: Resolving conflicts

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 2, 2006, 10:49 UTC
Message-ID
<Pine.LNX.4.63.0612021131140.28348@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vejri20mf.fsf@assigned-by-dhcp.cox.net>
Hi,
On Fri, 1 Dec 2006, Junio C Hamano wrote:
Show 17 quoted lines
> Linus Torvalds <torvalds@osdl.org> writes:
> 
> > [ Tangentially related.. ]
> >
> > On Thu, 30 Nov 2006, Wink Saville wrote:
> >> 
> >> Earlier had a problem with git wanting merge but didn't have it and
> >> couldn't figure out which package it was in Ubuntu:( So I symlinked merge
> >> to kdiff3 which worked at the time:
> >
> > Btw, what's the status of the xdl_merge() thing in "pu"?
> 
> I haven't looked at the code any further than minimally checking
> its external interface to be able to interface it with
> merge-recursive and no more.  Namely:
> 
>  - I haven't read the algorithm to judge its correctness;

With my track record of blamable patches, that should be done by somebody else than me.

>  - I haven't looked for leaks;
Neither have I.
>  - I haven't used the resulting merge-recursive in any real
>    merge; some of our tests do rely on a correctly working
>    merge-recursive, so it is not like the algorithm is always
>    emitting "boo ha ha" and returning no conflicts ;-).

I have. There is a subtle difference to merge, but it might be serious enough:

diff --just-made-up orig new1
 Hello world
+This conflicts
 Bye bye world
+This does not conflict
diff --just-made-up orig new2
 Hello world
+This is different in new2
 Bye bye world

If my interpretation of the test is correct, then the last line of new1 will _not_ conflict with xdl_merg( as is, but with RCS merge. I will fix that shortly.

>  - I haven't benched it to see how much performance is gained
>    by bypassing an extra fork+exec.

There is room for improvement, but I get shaky numbers betwen 31% and 118% (runtime git-merge-recursive xdl_merge() / RCS merge). These are extremely ad-hoc generated numbers, so handle with care. My gut feeling is that a few improvements in the code will give a rough 30%-50% in the average case.

These improvements include not parsing orig twice, and compacting the merge script before applying it.

> Among the four patches Johannes sent out to the list and Davide,
> one was already in his original patch I have in 'pu', another
> makes the same return value change I did myself when interfacing
> the code with merge-recursive.
Yeah, sorry. When I sent the patches, I did not see xdl_merge() in pu.
Show 12 quoted lines
> I have queued the remaining two in 'pu', so there should be nothing 
> missing.
> 
> One of them is marked as "fix off by one error" but it was about
> more than off by one (the code walks two arrays using one index
> for each, but the original code incorrectly used the same index
> to access both arrays at one point, which was also fixed).  I
> did mind the lack of explanation and wanted to reword the log
> message, but as I said, I haven't read the algorithm to
> understand what the code is doing enough, so I cannot write
> anything useful there yet X-<, which is one of the reasons why
> it is still queued in 'pu'.

Sorry again. I fixed that bug in the middle of the night, and committed the next day, trying to deduct what I fixed.

Again, I do not see the patches in pu, though. I will concoct a nice commit message later today, okay?

Linus, you raised the concern that git-cvsserer still relies on external merge. I'd just bastardize git-merge-one-file to work as a replacement of RCS merge (just like git apply works as a replacement of patch), in addition to its original function.

Ciao, Dscho

Previous: Junio C HamanoNext: Ramsay Jones
Message 15 of 32 in “Resolving conflicts”
  1. Wink SavilleDec 1, 2006
  2. Alan ChandlerDec 1, 2006
  3. Wink SavilleDec 1, 2006
  4. Alan ChandlerDec 1, 2006
  5. Linus TorvaldsDec 1, 2006
  6. Wink SavilleDec 1, 2006
  7. Linus TorvaldsDec 1, 2006
  8. Linus TorvaldsDec 1, 2006
  9. Alan ChandlerDec 1, 2006
  10. Wink SavilleDec 1, 2006
  11. Alan ChandlerDec 1, 2006
  12. Wink SavilleDec 2, 2006
  13. Linus TorvaldsDec 2, 2006
  14. Junio C HamanoDec 2, 2006
  15. using xdl_merge(), was Re: Resolving conflictsJohannes Schindelin, Dec 2, 2006
  16. Ramsay JonesDec 5, 2006
  17. Linus TorvaldsDec 5, 2006
  18. Junio C HamanoDec 5, 2006
  19. Johannes SchindelinDec 5, 2006
  20. Junio C HamanoDec 5, 2006
  21. xdl_merge(): fix and simplify conflict handlingJohannes Schindelin, Dec 5, 2006
  22. Junio C HamanoDec 5, 2006
  23. Johannes SchindelinDec 5, 2006
  24. Junio C HamanoDec 5, 2006
  25. Jakub NarebskiDec 5, 2006
  26. Johannes SchindelinDec 5, 2006
  27. Junio C HamanoDec 6, 2006
  28. Johannes SchindelinDec 6, 2006
  29. Junio C HamanoDec 6, 2006
  30. Johannes SchindelinDec 6, 2006
  31. Johannes SchindelinDec 5, 2006
  32. Linus TorvaldsDec 1, 2006

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.