Giter VIP home page Giter VIP logo

java-diff-utils's Introduction

Diff Utils library is an OpenSource library for performing the comparison operations between texts: computing diffs, applying patches, generating unified diffs or parsing them, generating diff output for easy future displaying (like side-by-side view) and so on.

Main reason to build this library was the lack of easy-to-use libraries with all the usual stuff you need while working with diff files. Originally it was inspired by JRCS library and it's nice design of diff module.

Main Features

  • computing the difference between two texts.
  • capable to hand more than plain ASCII. Arrays or List of any type that implements hashCode() and equals() correctly can be subject to differencing using this library
  • patch and unpatch the text with the given patch
  • parsing the unified diff format
  • producing human-readable differences

Algorithms

This library implements Myer's diff algorithm. But it can easily replaced by any other which is better for handing your texts. I have plan to add implementation of some in future.

Changelog

Version 1.2

  • JDK 1.5 compatibility
  • Ant build script
  • Generate output in unified diff format (thanks for Bill James)

To Install

Just add the code below to your maven dependencies:

<dependency>
    <groupId>com.googlecode.java-diff-utils</groupId>
    <artifactId>diffutils</artifactId>
    <version>1.3.0</version>
</dependency>

And for Ivy:

<dependency org="com.googlecode.java-diff-utils" name="diffutils" rev="1.3.0"/>

Coming eventually

  • support for inline diffs in output
  • helpers for showing side-by-side, line-by-line diffs or text with inter-line and intra-line change highlights
  • customization of diff algorithm for better experience while computing diffs between strings (ignoring blank lines or spaces, etc)
  • generating output in other formats (not only unified). E.g. CVS.

Tutorials

http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=CompararFicherosJavaDiffUtils (in Spanish). Thanks Miguel

java-diff-utils's People

Contributors

dnaumenko avatar simonmit avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.