summaryrefslogtreecommitdiff
path: root/include/git2/diff.h
Commit message (Collapse)AuthorAgeFilesLines
* diff: treat binary patches with no data specialethomson/diff-read-empty-binaryEdward Thomson2016-09-051-0/+8
| | | | | | When creating and printing diffs, deal with binary deltas that have binary data specially, versus diffs that have a binary file but lack the actual binary data.
* diff: document `git_diff_from_buffer`ethomson/doc_diff_from_bufferEdward Thomson2016-08-051-0/+19
|
* git_diff_file: move `id_abbrev`ethomson/diff_fileEdward Thomson2016-08-031-6/+6
| | | | | Move `id_abbrev` to a more reasonable place where it packs more nicely (before anybody starts using it).
* Introduce `git_diff_to_buf`Edward Thomson2016-05-261-0/+15
| | | | | Like `git_patch_to_buf`, provide a simple helper method that can print an entire diff directory to a `git_buf`.
* introduce `git_diff_from_buffer` to parse diffsEdward Thomson2016-05-261-0/+5
| | | | Parse diff files into a `git_diff` structure.
* diff: include oid length in deltasEdward Thomson2016-05-261-1/+7
| | | | | | Now that `git_diff_delta` data can be produced by reading patch file data, which may have an abbreviated oid, allow consumers to know that the id is abbreviated.
* Patch parsing from patch filesEdward Thomson2016-05-261-6/+8
|
* Fix typoEphemera2016-02-051-1/+1
|
* diff: include commit message when formatting patchPatrick Steinhardt2015-12-011-1/+4
| | | | | | When formatting a patch as email we do not include the commit's message in the formatted patch output. Implement this and add a test that verifies behavior.
* Add diff progress callback.Jason Haslam2015-11-021-5/+24
|
* iterator: better document GIT_DIFF_DISABLE_PATHSPEC_MATCHEdward Thomson2015-08-311-4/+6
|
* diff: drop `FILELIST_MATCH`Edward Thomson2015-08-301-7/+0
| | | | | Now that non-pathspec matching diffs are implemented at the iterator level, drop `FILELIST_MATCH`ing.
* diff: better document GIT_DIFF_PATHSPEC_DISABLEEdward Thomson2015-08-281-1/+3
| | | | | | Document that `GIT_DIFF_PATHSPEC_DISABLE` is not necessarily about explicit path matching, but also includes matching of directory names. Enforce this in a test.
* Move filelist into the iterator handling itself.Edward Thomson2015-08-281-0/+7
|
* Added git_diff_index_to_index()Pierre-Olivier Latour2015-06-301-0/+19
|
* Rename FALLBACK to UNSPECIFIEDcmn/rename-unspecifiedCarlos Martín Nieto2015-06-251-1/+1
| | | | | Fallback describes the mechanism, while unspecified explains what the user is thinking.
* submodule: add an ignore option to statusCarlos Martín Nieto2015-06-221-1/+1
| | | | | | | | | | | | | This lets us specify in the status call which ignore rules we want to use (optionally falling back to whatever the submodule has in its configuration). This removes one of the reasons for having `_set_ignore()` set the value in-memory. We re-use the `IGNORE_RESET` value for this as it is no longer relevant but has a similar purpose to `IGNORE_FALLBACK`. Similarly, we remove `IGNORE_DEFAULT` which does not have use outside of initializers and move that to fall back to the configuration as well.
* diff: introduce binary diff callbacksEdward Thomson2015-06-121-0/+55
| | | | | | | Introduce a new binary diff callback to provide the actual binary delta contents to callers. Create this data from the diff contents (instead of directly from the ODB) to support binary diffs including the workdir, not just things coming out of the ODB.
* Introduce `GIT_DIFF_FLAG_EXISTS`Edward Thomson2015-05-281-0/+1
| | | | | | | | | | Mark the `old_file` and `new_file` sides of a delta with a new bit, `GIT_DIFF_FLAG_EXISTS`, that introduces that a particular side of the delta exists in the diff. This is useful for indicating whether a working directory item exists or not, in the presence of a conflict. Diff users may have previously used DELETED to determine this information.
* diff/status: introduce conflictsEdward Thomson2015-05-281-10/+11
| | | | | | | | | | | When diffing against an index, return a new `GIT_DELTA_CONFLICTED` delta type for items that are conflicted. For a single file path, only one delta will be produced (despite the fact that there are multiple entries in the index). Index iterators now have the (optional) ability to return conflicts in the index. Prior to this change, they would be omitted, and callers (like diff) would omit conflicted index entries entirely.
* checkout: break case-changes into delete/addEdward Thomson2015-05-041-1/+6
| | | | | | | When checking out with a case-insensitive working directory, we want to change the case of items in the working directory to reflect changes that occured in the checkout target. Diff now has an option to break case-changing renames into delete/add.
* diff docs: update `git_diff_delta` descriptionEdward Thomson2015-02-031-3/+3
|
* Changed context_lines and interhunk_lines to uint32_t to match struct ↵Pierre-Olivier Latour2014-10-271-2/+2
| | | | s_xdemitconf
* Update some documentationCarlos Martín Nieto2014-10-181-2/+2
|
* Join typedef and struct definitions in single file.Ciro Santilli2014-09-241-6/+4
|
* Move the UNREADABLE enums to the correct group.Alan Rogers2014-07-221-6/+6
|
* Merge remote-tracking branch 'origin/development' into ↵Alan Rogers2014-06-041-30/+30
|\ | | | | | | | | | | | | fix-git-status-list-new-unreadable-folder Conflicts: include/git2/diff.h
| * Formatting fixes for the docsCarlos Martín Nieto2014-06-031-29/+29
| | | | | | | | | | These are some issues I found while playing around with the new parser for docurium.
* | GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKEDAlan Rogers2014-06-031-1/+4
| |
* | Start adding GIT_DELTA_UNREADABLE and GIT_STATUS_WT_UNREADABLE.Alan Rogers2014-05-201-0/+4
|/
* Make init_options fns use unsigned ints and macroRussell Belfer2014-05-021-22/+22
| | | | | Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string).
* Remove trace / add git_diff_perfdata struct + apiRussell Belfer2014-05-021-16/+14
|
* Get rid of redundant git_diff_options_init fnRussell Belfer2014-05-021-17/+0
| | | | Since git_diff_init_options was introduced, remove this old fn.
* Add diff option to update index stat cacheRussell Belfer2014-05-021-0/+7
| | | | | | | | | | When diff is scanning the working directory, if it finds a file where it is not sure if the index entry matches the working dir, it will recalculate the OID (which is pretty expensive). This adds a new flag to diff so that if the OID calculation finds that the file actually has not changed (i.e. just the modified time was altered or such), then it will refresh the stat cache in the index so that future calls to diff will not have to check the oid again.
* Merge pull request #2291 from ethomson/patch_binaryVicent Marti2014-04-231-0/+4
|\ | | | | patch: emit deflated binary patches (optionally)
| * patch: emit binary patches (optionally)Edward Thomson2014-04-221-0/+4
| |
* | Use git_diff_get_stats in example/diff + refactorRussell Belfer2014-04-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This takes the `--stat` and related example options in the example diff.c program and converts them to use the `git_diff_get_stats` API which nicely formats stats for you. I went to add bar-graph scaling to the stats formatter and noticed that the `git_diff_stats` structure was holding on to all of the `git_patch` objects. Unfortunately, each of these objects keeps the full text of the diff in memory, so this is very expensive. I ended up modifying `git_diff_stats` to keep just the data that it needs to keep and allowed it to release the patches. Then, I added width scaling to the output on top of that. In making the diff example program match 'git diff' output, I ended up removing an newline from the sumamry output which I then had to compensate for in the email formatting to match the expectations. Lastly, I went through and refactored the tests to use a couple of helper functions and reduce the overall amount of code there.
* | Some doc and examples/diff.c changesRussell Belfer2014-04-221-18/+11
|/ | | | | | | | | | | | | | I was playing with "git diff-index" and wanted to be able to emulate that behavior a little more closely with the diff example. Also, I wanted to play with running `git_diff_tree_to_workdir` directly even though core Git doesn't exactly have the equivalent, so I added a command line option for that and tweaked some other things in the example code. This changes a minor output thing in that the "raw" print helper function will no longer add ellipses (...) if the OID is not actually abbreviated.
* Introduce git_diff_format_email and git_diff_commit_as_emailJacques Germishuys2014-04-151-0/+88
|
* Introduce git_diff_get_stats, git_diff_stats_files_changed, ↵Jacques Germishuys2014-04-151-0/+85
| | | | git_diff_stats_insertions, git_diff_stats_deletions and git_diff_stats_to_buf
* Added function-based initializers for every options struct.Matthew Bowen2014-03-051-0/+26
| | | | The basic structure of each function is courtesy of arrbee.
* Add buffer to buffer diff and patch APIsRussell Belfer2014-02-271-0/+33
| | | | | | | | This adds `git_diff_buffers` and `git_patch_from_buffers`. This also includes a bunch of internal refactoring to increase the shared code between these functions and the blob-to-blob and blob-to-buffer APIs, as well as some higher level assert helpers in the tests to also remove redundancy.
* diff: change id abbrev option's name to id_abbrevCarlos Martín Nieto2014-01-251-1/+1
| | | | | Same as the other commits in the series, we use 'id' when talking about thing rather than the datatype.
* diff: rename the file's 'oid' to 'id'Carlos Martín Nieto2014-01-251-2/+2
| | | | In the same vein as the previous commits in this series.
* Update docs for new callback return value behaviorRussell Belfer2013-12-111-6/+6
|
* Add config read fns with controlled error behaviorRussell Belfer2013-12-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This adds `git_config__lookup_entry` which will look up a key in a config and return either the entry or NULL if the key was not present. Optionally, it can either suppress all errors or can return them (although not finding the key is not an error for this function). Unlike other accessors, this does not normalize the config key string, so it must only be used when the key is known to be in normalized form (i.e. all lower-case before the first dot and after the last dot, with no invalid characters). This also adds three high-level helper functions to look up config values with no errors and a fallback value. The three functions are for string, bool, and int values, and will resort to the fallback value for any error that arises. They are: * `git_config__get_string_force` * `git_config__get_bool_force` * `git_config__get_int_force` None of them normalize the config `key` either, so they can only be used for internal cases where the key is known to be in normal format.
* Clarify docsBen Straub2013-12-061-3/+3
|
* Clarify default value and behaviorBen Straub2013-12-061-1/+5
|
* Introduce GIT_DIFF_FIND_BY_CONFIGBen Straub2013-12-051-0/+3
|
* GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds betterRussell Belfer2013-12-021-2/+2
|