This patch series provides a rudimentary, working implementation of "jgit diff". It does not provide all modes of "git diff" -- by far! -- but it is robust, and should provide a good starting point for further work. Unfortunately, I lack the time to do proper profiling/benchmarking, but I verified at least that it succeeds in recreating valid patches for all commits in jgit.git with this script: git rev-list HEAD | sed '$d' | while read commit do printf "\\r$commit " (export GIT_INDEX_FILE=test-index && ./jgit diff $commit^ $commit > test-patch && git read-tree $commit^ && git apply --cached test-patch && git diff --exit-code --cached $commit) || break done Johannes Schindelin (5): Add set to IntList Add Myers' algorithm to generate diff scripts Add a test class for Myers' diff algorithm Prepare RawText for diff-index and diff-files Add the "jgit diff" command .../services/org.spearce.jgit.pgm.TextBuiltin | 1 + .../src/org/spearce/jgit/pgm/Diff.java | 133 +++++ .../tst/org/spearce/jgit/diff/MyersDiffTest.java | 103 ++++ .../tst/org/spearce/jgit/util/IntListTest.java | 21 + .../src/org/spearce/jgit/diff/DiffFormatter.java | 2 +- .../src/org/spearce/jgit/diff/MyersDiff.java | 515 ++++++++++++++++++++ .../src/org/spearce/jgit/diff/RawText.java | 28 +- .../src/org/spearce/jgit/util/IntList.java | 17 + 8 files changed, 818 insertions(+), 2 deletions(-) create mode 100644 org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/Diff.java create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/diff/MyersDiffTest.java create mode 100644 org.spearce.jgit/src/org/spearce/jgit/diff/MyersDiff.java -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html