{"action":"created","issue":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/3177","labels_url":"https://api.github.com/repos/libgit2/libgit2/issues/3177/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/3177/comments","events_url":"https://api.github.com/repos/libgit2/libgit2/issues/3177/events","html_url":"https://github.com/libgit2/libgit2/pull/3177","id":84243692,"number":3177,"title":"Binary diffs: store deltas in the diff structure, include binary data in diff callbacks","user":{"login":"ethomson","id":1130014,"avatar_url":"https://avatars.githubusercontent.com/u/1130014?v=3","gravatar_id":"","url":"https://api.github.com/users/ethomson","html_url":"https://github.com/ethomson","followers_url":"https://api.github.com/users/ethomson/followers","following_url":"https://api.github.com/users/ethomson/following{/other_user}","gists_url":"https://api.github.com/users/ethomson/gists{/gist_id}","starred_url":"https://api.github.com/users/ethomson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethomson/subscriptions","organizations_url":"https://api.github.com/users/ethomson/orgs","repos_url":"https://api.github.com/users/ethomson/repos","events_url":"https://api.github.com/users/ethomson/events{/privacy}","received_events_url":"https://api.github.com/users/ethomson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-02T22:38:29Z","updated_at":"2015-06-03T13:43:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/libgit2/libgit2/pulls/3177","html_url":"https://github.com/libgit2/libgit2/pull/3177","diff_url":"https://github.com/libgit2/libgit2/pull/3177.diff","patch_url":"https://github.com/libgit2/libgit2/pull/3177.patch"},"body":"First, always load the actual diff file contents when we're being asked to show binary data in the diffs, instead of trying to load it from the ODB to produce it on-demand.  Although it would be nice to simply load it from the ODB, we obviously may not actually be producing a diff from an entry in the ODB.  The diff file contents encompasses all diff data origins, be it from the index/tree (and thus the ODB) or directly from the working directory.\r\n\r\nSecond, include the binary data in the diff callbacks (instead of pumping it through the file callback).  Although this is a signature change, it enables a much nicer mechanism so that callers like `git_diff_blobs` can load the binary data.\r\n\r\n(These changes are important to being able to create binary patches from the index and working directory data.)"},"comment":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/comments/108420844","html_url":"https://github.com/libgit2/libgit2/pull/3177#issuecomment-108420844","issue_url":"https://api.github.com/repos/libgit2/libgit2/issues/3177","id":108420844,"user":{"login":"ethomson","id":1130014,"avatar_url":"https://avatars.githubusercontent.com/u/1130014?v=3","gravatar_id":"","url":"https://api.github.com/users/ethomson","html_url":"https://github.com/ethomson","followers_url":"https://api.github.com/users/ethomson/followers","following_url":"https://api.github.com/users/ethomson/following{/other_user}","gists_url":"https://api.github.com/users/ethomson/gists{/gist_id}","starred_url":"https://api.github.com/users/ethomson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethomson/subscriptions","organizations_url":"https://api.github.com/users/ethomson/orgs","repos_url":"https://api.github.com/users/ethomson/repos","events_url":"https://api.github.com/users/ethomson/events{/privacy}","received_events_url":"https://api.github.com/users/ethomson/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T13:43:08Z","updated_at":"2015-06-03T13:43:08Z","body":"Oops, looks like we call `diff` everywhere.  I rebased this on master!"}}