libgit2/libgit2 — pull request #1007 by ethomson (2012-10-22 02:05:56+00:00)
Title: merge (work in progress)

I've been working on merges -- this is very much a work in progress and *not* ready for inclusion, but I wanted to start getting feedback.

This is intended to be modeled - as much as possible - after git's architecture of a pluggable merge tool. Consumers can plug in their own merge function. Further, the merge functions can take some data - similar to `git-merge-resolve` can take a resolution strategy (ours, theirs, etc.)

1. This needs a merge with the head of development, obviously.
2. I started on `git_diff_many_from_iterators` such that it could be suitable for an arbitrary iterator, but it's currently only suitable for tree iterators and lacks the logic in the 2-way iterator. It either needs that logic, or be renamed as `_from_tree_iterators` and enforced, or become private... etc.
3. This does not yet update the index with unmerged data. (I'm working on writing unmerged entries to the index at present.)
4. Code formatting is messy.
5. No unit tests yet
6. I added `git_merge_abort` which was intended to be akin to `git merge --abort`. I'm not certain that `git reset --merge` is equivalent to `git merge --abort`. (I suspect there are differences that I don't yet see.)
7. Various TODOs are sprinkled throughout.