Skip to main content

Blame Trees

  • Conference paper
Algorithms and Data Structures (WADS 2013)

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

Included in the following conference series:

  • 2046 Accesses

Abstract

We consider the problem of merging individual text documents, motivated by the single-file merge algorithms of document-based version control systems. Abstracting away the merging of conflicting edits to an external conflict resolution function (possibly implemented by a human), we consider the efficient identification of conflicting regions. We show how to implement tree-based document representation to quickly answer a data structure inspired by the “blame” query of some version control systems. A “blame” query associates every line of a document with the revision in which it was last edited. Our tree uses this idea to quickly identify conflicting edits. We show how to perform a merge operation in time proportional to the sum of the logarithms of the shared regions of the documents, plus the cost of conflict resolution. Our data structure is functional and therefore confluently persistent, allowing arbitrary version DAGs as in real version-control systems. Our results rely on concurrent traversal of two trees with short circuiting when shared subtrees are encountered.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Bender, M.A., Cole, R., Demaine, E.D., Farach-Colton, M., Zito, J.: Two simplified algorithms for maintaining order in a list. In: Möhring, R.H., Raman, R. (eds.) ESA 2002. LNCS, vol. 2461, pp. 152–164. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  2. Carlsson, S., Levcopoulos, C., Petersson, O.: Sublinear merging and natural mergesort. Algorithmica 9, 629–648 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  3. Cohen, B.: Git can’t be made consistent (April 2011), http://bramcohen.livejournal.com/74462.html

  4. Demaine, E.D., Langerman, S., Price, E.: Confluently persistent tries for efficient version control. Algorithmica 57(3), 462–483 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  5. Demaine, E.D., López-Ortiz, A., Munro, J.I.: Adaptive set intersections, unions, and differences. In: Proceedings of the 11th Annual ACM-SIAM Symposium on Discrete Algorithms, San Francisco, California, pp. 743–752 (January 2000)

    Google Scholar 

  6. Dietz, P.F., Sleator, D.D.: Two algorithms for maintaining order in a list. In: Proceedings of the 19th Annual ACM Symposium on Theory of Computing, New York City, pp. 365–372 (May 1987)

    Google Scholar 

  7. Driscoll, J.R., Sarnak, N., Sleator, D.D., Tarjan, R.E.: Making data structures persistent. Journal of Computer and System Sciences 38(1), 86–124 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  8. Fiat, A., Kaplan, H.: Making data structures confluently persistent. In: Proceedings of the 12th Annual Symposium on Discrete Algorithms, Washington, DC, pp. 537–546 (January 2001)

    Google Scholar 

  9. Hudson, G.: Notes on keeping version histories of files (October 2002), http://web.mit.edu/ghudson/thoughts/file-versioning

  10. Mehlhorn, K.: Data Structures and Algorithms. Sorting and Searching, vol. 1, pp. 240–241. Springer (1984)

    Google Scholar 

  11. Moffat, A., Petersson, O., Wormald, N.C.: A tree-based Mergesort. Acta Informatica 35(9), 775–793 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  12. Okasaki, C.: Purely functional data structures. Cambridge University Press, New York (1998)

    Book  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Demaine, E.D., Panchekha, P., Wilson, D.A., Yang, E.Z. (2013). Blame Trees. In: Dehne, F., Solis-Oba, R., Sack, JR. (eds) Algorithms and Data Structures. WADS 2013. Lecture Notes in Computer Science, vol 8037. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-40104-6_25

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-40104-6_25

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-40103-9

  • Online ISBN: 978-3-642-40104-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics