libgit2/libgit2 — pull request #1897 by arrbee (2013-10-10 20:36:58+00:00)
Title: RFC: Proposed reworking of diff APIs

This completely scrambles the diff APIs, splitting out a new `include/git2/patch.h` with the functions to create and access patch objects. This also completely changes the helper functions that allow formatting output from a diff and moves all the options for formatting out of the `git_diff_options` and into a new structure `git_diff_format_options` that can be provided after the diff has already been generated.

Perhaps the most radical change is actually proposing that a `git_delta` (formerly a `git_diff_delta`) would contain an array of `git_delta_file` objects (formerly `git_diff_file`) instead of always containing two. This means that simple deltas (added, removed, ignored, untracked) can contain just one, regular deltas (modified, copied, renamed) can contain two, and there will be space for adding deltas that represent merge conflicts in the future.

At the moment, this is just a proposal limited to updating the header files. I'm curious if the reworked API seems simpler to use and understand compared to the old one, or if it just seems like a lot of change to no purpose. I tried to go as radical as I could in this first revision with the idea that we can scale back the degree of change depending on what seems to make sense.