A Formal Investigation of Diff3
- 528 Downloads
The diff3 algorithm is widely considered the gold standard for merging uncoordinated changes to list-structured data such as text files. Surprisingly, its fundamental properties have never been studied in depth.
We offer a simple, abstract presentation of the diff3 algorithm and investigate its behavior. Despite abundant anecdotal evidence that people find diff3’s behavior intuitive and predictable in practice, characterizing its good properties turns out to be rather delicate: a number of seemingly natural intuitions are incorrect in general. Our main result is a careful analysis of the intuition that edits to “well-separated” regions of the same document are guaranteed never to conflict.
KeywordsFormal Investigation Maximum Match Synchronization Algorithm Longe Common Subsequence Approximate String Match
Unable to display preview. Download preview PDF.
- 1.Smith, R.: GNU diff3, Version 2.8.1, April 2002; distributed with GNU diffutils package (1988)Google Scholar
- 4.Lanham, M., Kang, A., Hammer, J., Helal, A., Wilson, J.: Format-independent change detection and propagation in support of mobile computing. In: Brazilian Symposium on Databases (SBBD), Gramado, Brazil, pp. 27–41 (October 2002)Google Scholar
- 5.MacKenzie, D., Eggert, P., Stallman, R.: Comparing and Merging Files with GNU diff and patch. Network Theory Ltd. Printed version of GNU manual (2003)Google Scholar
- 9.Foster, J.N., Greenwald, M.B., Kirkegaard, C., Pierce, B.C., Schmitt, A.: Exploiting schemas in data synchronization. Journal of Computer and System Sciences (2007) To appear. Extended abstract in Database Programming Languages (DBPL) (2005)Google Scholar
- 11.Stallman, R., et al.: Comparing and merging files, Manual for GNU diffutils (2002), available at www.gnu.org