libgit2/libgit2 — pull request #1965 by arrbee (2013-11-15 22:07:27+00:00)
Title: Add `git_diff_commit` and `last-changed` example

This adds a new diff API `git_diff_commit` which makes it easy to generate a `git_diff` object that represents the changes in a given commit. It follows the core Git rules for considering changes in a merge commit - i.e. if a file has an exact match in any parent of the commit, then the file is considered unmodified by the merge.

This also adds a new example program `examples/last-changed.c` which takes a list of filenames and for each one displays the SHA of the last commit that changed that file.

- [x] Add `last-changed` example program to find the last commit to touch a file
- [x] Add `git_diff_commit` API
- [x] Handle the 0 and 1 parent of commit cases
- [x] Find MODIFIED files according to rules of Git core
- [x] Find ADDED files
- [ ] Find DELETED files
- [ ] Add `clar` tests beyond just the example program