Skip to main content

A Formal Investigation of Diff3

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4855))

Abstract

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Smith, R.: GNU diff3, Version 2.8.1, April 2002; distributed with GNU diffutils package (1988)

    Google Scholar 

  2. Lindholm, T.: A three-way merge for xml documents. In: DocEng 2004: Proceedings of the 2004 ACM symposium on Document engineering, pp. 1–10. ACM Press, New York (2004)

    Chapter  Google Scholar 

  3. Chawathe, S.S., Rajamaran, A., Garcia-Molina, H., Widom, J.: Change detection in hierarchically structured information. ACM SIGMOD Record 25(2), 493–504 (1996)

    Article  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 

  6. Miller, W., Myers, E.W.: A file comparison program. Softw., Pract. Exper. 15(11), 1025–1040 (1985)

    Article  Google Scholar 

  7. Myers, E.W.: An o(nd) difference algorithm and its variations. Algorithmica 1(2), 251–266 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  8. Ukkonen, E.: Algorithms for approximate string matching. Information and Control 64(1-3), 100–118 (1985)

    Article  MathSciNet  MATH  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 

  10. Mens, T.: A state-of-the-art survey on software merging. IEEE Trans. Software Eng. 28(5), 449–462 (2002)

    Article  Google Scholar 

  11. Stallman, R., et al.: Comparing and merging files, Manual for GNU diffutils (2002), available at www.gnu.org

Download references

Author information

Authors and Affiliations

Authors

Editor information

V. Arvind Sanjiva Prasad

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Khanna, S., Kunal, K., Pierce, B.C. (2007). A Formal Investigation of Diff3. In: Arvind, V., Prasad, S. (eds) FSTTCS 2007: Foundations of Software Technology and Theoretical Computer Science. FSTTCS 2007. Lecture Notes in Computer Science, vol 4855. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-77050-3_40

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-77050-3_40

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-77049-7

  • Online ISBN: 978-3-540-77050-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics