3

Possible Duplicate:
Three Way Merge Algorithms for Text

I would like to learn what are the standard algorithms used in 3-way merges by common version control systems, like Git or Mercurial. I imagine there should be some common algorithm known by people in the field, but the Wikipedia page about 3-way merge does not enter into any detail.

Community
  • 1
  • 1
Andrea
  • 20,253
  • 23
  • 114
  • 183
  • There are several other questions already out there such as http://stackoverflow.com/questions/1203725/three-way-merge-algorithms-for-text?rq=1 that provide info on where to find out more info on 3-way merges. – Alan Barber Aug 09 '12 at 16:51
  • Unfortunately, neither the linked question, nor any link present in it, describe an actual algorithm to perform the merge. I have read the paper linked by the chosen answer, and while it discusses some gotchas, it does not explain how to solve them. – Andrea Aug 09 '12 at 16:53
  • Just a quick search but I found the source for diff3, a 3 way text merge gnu utility included in most *nix oses... This is the one used on mac osx -> http://www.opensource.apple.com/source/gnudiff/gnudiff-10/diffutils/diff3.c Best way to learn a algo is look at the code! – Alan Barber Aug 09 '12 at 17:14
  • @AlanBarber Thank you for the link, I will have a look. On the other hand, I am not familiar with C (and I believe the best way to learn an algorithm is to read a description in words :-D), so I will be happy to get more sources. – Andrea Aug 09 '12 at 17:29

0 Answers0