src/diff_output.c


Log

Author Commit Date CI Message
Russell Belfer f917481e 2012-05-03T16:37:25 Support reading attributes from index Depending on the operation, we need to consider gitattributes in both the work dir and the index. This adds a parameter to all of the gitattributes related functions that allows user control of attribute reading behavior (i.e. prefer workdir, prefer index, only use index). This fix also covers allowing us to check attributes (and hence do diff and status) on bare repositories. This was a somewhat larger change that I hoped because it had to change the cache key used for gitattributes files.
Vicent Martí 40879fac 2012-05-02T15:59:02 Merge branch 'new-error-handling' into development Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
Russell Belfer 3fd99be9 2012-03-05T09:30:17 Convert from strnlen to git_text_is_binary Since strnlen is not supported on all platforms and since we now have the shiny new git_text_is_binary in the filtering code, let's convert diff binary detection to use the new stuff.
Russell Belfer 8b2bcfbe 2012-03-05T09:14:56 Copy values to avoid strict aliasing warning To make this code more resilient to future changes, we'll explicitly translate the libgit2 structure to the libxdiff structure.
Russell Belfer 16b83019 2012-03-04T23:28:36 Fix usage of "new" for fieldname in public header This should restore the ability to include libgit2 headers in C++ projects. Cherry picked 2de60205dfea2c4a422b2108a5e8605f97c2e895 from development into new-error-handling.
nulltoken 1d2dd864 2012-04-29T19:42:51 diff: provide more context to the consumer of the callbacks Update the callback to provide some information related to the file change being processed and the range of the hunk, when applicable.
nulltoken eb3d71a5 2012-04-25T22:23:35 diff: fix generation of the header of a removal patch
Russell Belfer 66142ae0 2012-03-22T10:44:36 New status fixes This adds support for roughly-right tracking of submodules (although it does not recurse into submodules to detect internal modifications a la core git), and it adds support for including unmodified files in diff iteration if requested.
schu 7826d577 2012-03-21T10:00:54 diff_output: remove unused parameter Signed-off-by: schu <schu-github@schulog.org>
Russell Belfer ae9e29fd 2012-03-06T16:14:31 Migrating diff to new error handling Ended up migrating a bunch of upstream functions as well including vector, attr_file, and odb in order to get this to work right.
Vicent Martí cb8a7961 2012-03-07T00:02:55 error-handling: Repository This also includes droping `git_buf_lasterror` because it makes no sense in the new system. Note that in most of the places were it has been dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so instead it should return a generic `-1` and obviously not throw anything.
Authmillenon 5621d809 2012-03-06T17:51:04 Rename git_oid_to_string to git_oid_tostr To conform the naming scheme of git_oid_fromstr we should change the name of git_oid_to_string to git_oid_tostr.
Russell Belfer c4c4bc1f 2012-03-05T09:30:17 Convert from strnlen to git_text_is_binary Since strnlen is not supported on all platforms and since we now have the shiny new git_text_is_binary in the filtering code, let's convert diff binary detection to use the new stuff.
Russell Belfer 28b486b2 2012-03-05T09:14:56 Copy values to avoid strict aliasing warning To make this code more resilient to future changes, we'll explicitly translate the libgit2 structure to the libxdiff structure.
Russell Belfer 2de60205 2012-03-04T23:28:36 Fix usage of "new" for fieldname in public header This should restore the ability to include libgit2 headers in C++ projects.
Russell Belfer 529df4df 2012-03-02T15:57:06 Fixes for merge of filters branch
Russell Belfer e1bcc191 2012-03-01T11:45:00 Revert GIT_STATUS constants to avoid issues This reverts the changes to the GIT_STATUS constants and adds a new enumeration to describe the type of change in a git_diff_delta. I don't love this solution, but it should prevent strange errors from occurring for now. Eventually, I would like to unify the various status constants, but it needs a larger plan and I just wanted to eliminate this breakage quickly.
Russell Belfer 854eccbb 2012-02-29T12:04:59 Clean up GIT_UNUSED macros on all platforms It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
Russell Belfer 74fa4bfa 2012-02-28T16:14:47 Update diff to use iterators This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.