summaryrefslogtreecommitdiff
path: root/include/git2/patch.h
Commit message (Collapse)AuthorAgeFilesLines
* patch: add owner accessorJason Haslam2020-12-111-0/+8
|
* patch_generate: represent buffers as void pointersPatrick Steinhardt2017-07-101-2/+2
| | | | | | | | | | | Pointers to general data should usually be used as a void pointer such that it is possible to hand in variables of a different pointer type without the need to cast. This is the same when creating patches from buffers, where the buffers may contain arbitrary data. Instead of requiring the caller to care whether his buffer is e.g. `char *` or `unsigned char *`, we should instead just accept a `void *`. This is also consistent in how we tread other types like for example `git_blob`, which also just has a void pointer as its raw contents.
* patch: minor documentation fix.Davide Coppola2016-10-161-1/+1
| | | | Fix @return description of git_patch_num_lines_in_hunk.
* diff docs: update `git_diff_delta` descriptionEdward Thomson2015-02-031-6/+3
|
* Fix const-correctness of git_patch_get_delta, git_patch_num_hunks, ↵Jacques Germishuys2014-04-111-3/+3
| | | | git_patch_num_lines_in_hunk
* Add buffer to buffer diff and patch APIsRussell Belfer2014-02-271-0/+28
| | | | | | | | 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.
* Drop git_patch_to_strNicolas Hake2014-01-221-11/+0
| | | | | | | It's hard or even impossible to correctly free the string buffer allocated by git_patch_to_str in some circumstances. Drop the function so people have to use git_patch_to_buf instead - git_buf has a dedicated destructor.
* Expose patch serialization to git_bufNicolas Hake2014-01-221-0/+10
| | | | | | | | | | | Returning library-allocated strings from libgit2 works fine on Linux, but may cause problems on Windows because there is no one C Runtime that everything links against. With libgit2 not exposing its own allocator, freeing the string is a gamble. git_patch_to_str already serializes to a buffer, then returns the underlying memory. Expose the functionality directly, so callers can use the git_buf_free function to free the memory later.
* Update docs for new callback return value behaviorRussell Belfer2013-12-111-2/+2
|
* Create git_diff_line and extend git_diff_hunkRussell Belfer2013-10-211-15/+2
| | | | | | | | | | | | | Instead of having functions with so very many parameters to pass hunk and line data, this takes the existing git_diff_hunk struct and extends it with more hunk data, plus adds a git_diff_line. Those structs are used to pass back hunk and line data instead of the old APIs that took tons of parameters. Some work that was previously only being done for git_diff_patch creation (scanning the diff content for exact line counts) is now done for all callbacks, but the performance difference should not be noticable.
* Diff API cleanupRussell Belfer2013-10-151-12/+5
| | | | | | | | This lays groundwork for separating formatting options from diff creation options. This groups the formatting flags separately from the diff list creation flags and reorders the options. This also tweaks some APIs to further separate code that uses patches from code that just looks at git_diffs.
* Rename diff objects and split patch.hRussell Belfer2013-10-111-0/+270
This makes no functional change to diff but renames a couple of the objects and splits the new git_patch (formerly git_diff_patch) into a new header file.