libgit2/libgit2 — pull request #550 by arrbee (2012-02-04 01:17:17+00:00)
Title: Implement git diff tree-to-tree

This is an initial implement of git-diff just with support for diffing one tree to another (and one blob to another). It also establishes the framework that would be used to implement the other diff patterns. The basic framework is that diff is performed in 2 or 3 phases:

1. Create a diff list by traversing the objects in question
2. Optionally, post-process the diff list to do things like rename detection
3. Traverse the diff to use the content of it (e.g. output a patch, etc.)

This structure is blatantly taken from core git and lets us easily share patch formatting code, etc., across the various types of diffs that can be generated.

This version of the implementation is clearly still quite limited, but is hopefully something to build on.

* It can only diff trees against trees
* Rename detection is unimplemented
* Binary file detection only uses the "diff" attribute, not any smart algorithm
* Most of the options that would control how the diff appears are unimplemented