src/apply.c


Log

Author Commit Date CI Message
Patrick Steinhardt 0c7f49dd 2017-06-30T13:39:01 Make sure to always include "common.h" first Next to including several files, our "common.h" header also declares various macros which are then used throughout the project. As such, we have to make sure to always include this file first in all implementation files. Otherwise, we might encounter problems or even silent behavioural differences due to macros or defines not being defined as they should be. So in fact, our header and implementation files should make sure to always include "common.h" first. This commit does so by establishing a common include pattern. Header files inside of "src" will now always include "common.h" as its first other file, separated by a newline from all the other includes to make it stand out as special. There are two cases for the implementation files. If they do have a matching header file, they will always include this one first, leading to "common.h" being transitively included as first file. If they do not have a matching header file, they instead include "common.h" as first file themselves. This fixes the outlined problems and will become our standard practice for header and source files inside of the "src/" from now on.
Edward Thomson 909d5494 2016-12-29T12:25:15 giterr_set: consistent error messages Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
Patrick Steinhardt c77a55a9 2016-11-14T10:05:31 common: use PRIuZ for size_t in `giterr_set` calls
Edward Thomson adedac5a 2016-09-02T02:03:45 diff: treat binary patches with no data special 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.
Patrick Steinhardt 274a727e 2016-08-05T10:57:42 apply: fix warning when initializing patch images
Edward Thomson 581a4d39 2016-07-14T23:32:35 apply: safety check files that dont end with eol
Edward Thomson 531be3e8 2016-07-14T22:59:37 apply: compare preimage to image Compare the preimage to the image; don't compare the preimage to itself.
Edward Thomson 53571f2f 2015-11-21T15:16:01 vector: more sensible names for `grow_at`/`shrink_at`
Edward Thomson 0267c34c 2015-09-25T10:19:50 patch application: drop unnecessary `patch_image_init`
Edward Thomson b85bd8ce 2015-09-16T11:37:03 patch: use delta's old_file/new_file members No need to replicate the old_file/new_file members, or plumb them strangely up.
Edward Thomson 804d5fe9 2015-09-11T08:37:12 patch: abstract patches into diff'ed and parsed Patches can now come from a variety of sources - either internally generated (from diffing two commits) or as the results of parsing some external data.
Edward Thomson 3149ff6f 2015-06-17T18:13:10 patch application: apply binary patches Handle the application of binary patches. Include tests that produce a binary patch (an in-memory `git_patch` object), then enusre that the patch applies correctly.
Edward Thomson 0004386f 2015-06-17T06:03:01 apply: handle empty patches When a patch is empty, simply copy the source into the destination.
Edward Thomson 7cb904ba 2014-04-01T23:58:59 Introduce git_apply_patch The beginnings of patch application from an existing (diff-created) git_patch object: applies the hunks of a git_patch to a buffer.