summaryrefslogtreecommitdiff
path: root/src/diff.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * Reimplment git_status_foreach using git diffRussell Belfer2012-03-211-22/+12
| | | | | | | | | | This is an initial reimplementation of status using diff a la the way that core git does it.
| * Convert attr, ignore, mwindow, status to new errorsRussell Belfer2012-03-161-2/+2
| | | | | | | | | | Also cleaned up some previously converted code that still had little things to polish.
| * Migrating diff to new error handlingRussell Belfer2012-03-061-102/+84
| | | | | | | | | | | | Ended up migrating a bunch of upstream functions as well including vector, attr_file, and odb in order to get this to work right.
* | Fix usage of "new" for fieldname in public headerRussell Belfer2012-03-041-98/+100
|/ | | | | This should restore the ability to include libgit2 headers in C++ projects.
* Revert GIT_STATUS constants to avoid issuesRussell Belfer2012-03-021-22/+22
| | | | | | | | | 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.
* Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-021-1/+1
| | | | | | | | | | | | | | | | | | | 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.
* Update diff to use iteratorsRussell Belfer2012-03-021-962/+385
| | | | | | | | | | | | | 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.
* First pass of diff index to workdir implementationRussell Belfer2012-03-021-56/+320
| | | | | | | | | | This is an initial version of git_diff_workdir_to_index. It also includes renaming some structures and some refactoring of the existing code so that it could be shared better with the new function. This is not complete since it needs a rebase to get some new odb functions from the upstream branch.
* Add tests and fix bugs for diff whitespace optionsRussell Belfer2012-03-021-8/+8
| | | | | | Once I added tests for the whitespace handling options of diff, I realized that there were some bugs. This fixes those and adds the new tests into the test suite.
* Continue implementation of git-diffRussell Belfer2012-03-021-146/+324
| | | | | | | | * Implemented git_diff_index_to_tree * Reworked git_diff_options structure to handle more options * Made most of the options in git_diff_options actually work * Reorganized code a bit to remove some redundancy * Added option parsing to examples/diff.c to test most options
* Fix minor WIN32 incompatibilityRussell Belfer2012-03-021-1/+4
| | | | | | | | File mode flags are not all defined on WIN32, but since git is so rigid in how it uses file modes, there is no reason not to hard code a particular value. Also, this is only used in the git_diff_print_compact helper function, so it is really really not important.
* Clean up diff implementation for reviewRussell Belfer2012-03-021-62/+261
| | | | | | | This fixes several bugs, updates tests and docs, eliminates the FILE* assumption in favor of printing callbacks for the diff patch formatter helpers, and adds a "diff" example function that can perform a diff from the command line.
* Implement diff lists and formattersRussell Belfer2012-03-021-29/+455
| | | | | | | | This reworks the diff API to separate the steps of producing a diff descriptions from formatting the diff. This will allow us to share diff output code with the various diff creation scenarios and will allow us to implement rename detection as an optional pass that can be run on a diff list.
* Initial implementation of git_diff_blobRussell Belfer2012-03-021-0/+104
This gets the basic plumbing in place for git_diff_blob. There is a known issue where additional parameters like the number of lines of context to display on the diff are not working correctly (which leads one of the new unit tests to fail).