summaryrefslogtreecommitdiff
path: root/include/git2/diff.h
Commit message (Collapse)AuthorAgeFilesLines
...
* diff: make inter-hunk-context default value git-compliantyorah2012-07-021-1/+1
| | | | Default in git core is 0, not 3
* Minor fixes, cleanups, and clarificationsRussell Belfer2012-06-081-22/+69
| | | | | | | | | | | | | | | | | | | | | | | There are three actual changes in this commit: 1. When the trailing newline of a file is removed in a diff, the change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed to the callback. Previously, the `ADD_EOFNL` constant was given which was just an error in my understanding of when the various circumstances arose. `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and should never be generated. A new newline is simply an `ADD`. 2. Rewrote the `diff_delta__merge_like_cgit` function that contains the core logic of the `git_diff_merge` implementation. The new version doesn't actually have significantly different behavior, but the logic should be much more obvious, I think. 3. Fixed a bug in `git_diff_merge` where it freed a string pool while some of the string data was still in use. This led to `git_diff_print_patch` accessing memory that had been freed. The rest of this commit contains improved documentation in `diff.h` to make the behavior and the equivalencies with core git clearer, and a bunch of new tests to cover the various cases, oh and a minor simplification of `examples/diff.c`.
* misc: Fix warnings from PVS Studio trialVicent Martí2012-06-071-1/+1
|
* Fix spelling errors.Bruce Mitchener2012-05-191-1/+1
|
* diff: improve git_diff_blobs() documentationnulltoken2012-05-071-0/+8
|
* diff: make git_diff_blobs() able to detect binary blobsnulltoken2012-05-071-0/+1
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-021-21/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix usage of "new" for fieldname in public headerRussell Belfer2012-05-021-16/+16
| | | | | | | | | | | | | | | | This should restore the ability to include libgit2 headers in C++ projects. Cherry picked 2de60205dfea2c4a422b2108a5e8605f97c2e895 from development into new-error-handling.
| * diff: provide more context to the consumer of the callbacksnulltoken2012-04-301-20/+17
| | | | | | | | Update the callback to provide some information related to the file change being processed and the range of the hunk, when applicable.
| * Fix crash in new status and add recurse optionRussell Belfer2012-03-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the bug that @nulltoken found (thank you!) where if there were untracked directories alphabetically after the last tracked item, the diff implementation would deref a NULL pointer. The fix involved the code which decides if it is necessary to recurse into a directory in the working dir, so it was easy to add a new option `GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS` to control if the contents of untracked directories should be included in status.
| * New status fixesRussell Belfer2012-03-221-1/+2
| | | | | | | | | | | | | | 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.
* | diff_output: remove unused parameterschu2012-03-211-1/+0
| | | | | | | | Signed-off-by: schu <schu-github@schulog.org>
* | Fix usage of "new" for fieldname in public headerRussell Belfer2012-03-041-16/+16
|/ | | | | This should restore the ability to include libgit2 headers in C++ projects.
* Revert GIT_STATUS constants to avoid issuesRussell Belfer2012-03-021-1/+15
| | | | | | | | | 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.
* Update diff to use iteratorsRussell Belfer2012-03-021-21/+80
| | | | | | | | | | | | | 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.
* Continue implementation of git-diffRussell Belfer2012-03-021-9/+25
| | | | | | | | * 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
* Clean up diff implementation for reviewRussell Belfer2012-03-021-22/+140
| | | | | | | 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-46/+91
| | | | | | | | 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/+103
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).