summaryrefslogtreecommitdiff
path: root/src/merge_file.c
Commit message (Collapse)AuthorAgeFilesLines
* merge_file: use GIT_ASSERTEdward Thomson2020-11-271-3/+11
|
* tree-wide: mark local functions as staticPatrick Steinhardt2020-06-091-6/+4
| | | | | | | We've accumulated quite some functions which are never used outside of their respective code unit, but which are lacking the `static` keyword. Add it to reduce their linkage scope and allow the compiler to optimize better.
* fileops: rename to "futils.h" to match function signaturesPatrick Steinhardt2019-07-201-1/+1
| | | | | | | | | Our file utils functions all have a "futils" prefix, e.g. `git_futils_touch`. One would thus naturally guess that their definitions and implementation would live in files "futils.h" and "futils.c", respectively, but in fact they live in "fileops.h". Rename the files to match expectations.
* git_error: use new names in internal APIs and usageEdward Thomson2019-01-221-1/+1
| | | | | Move to the `git_error` name in the internal API for error-related functions.
* merge: allow custom conflict marker sizeEdward Thomson2018-01-211-0/+2
| | | | | | Allow for a custom conflict marker size, allowing callers to override the default size of the "<<<<<<<" and ">>>>>>>" markers in the conflicted output file.
* Make sure to always include "common.h" firstPatrick Steinhardt2017-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* giterr_set: consistent error messagesEdward Thomson2016-12-291-1/+1
| | | | | | | | 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
* merge_file: do not unnecessarily check ours/theirs for NULLPatrick Steinhardt2016-05-021-4/+4
| | | | | | | | | The `merge_file__xdiff` function checks if either `ours` or `theirs` is `NULL`. The function is to be called with existing files, though, and in fact already unconditionally dereferences both pointers. Remove the unnecessary check to silence warnings.
* merge driver: introduce custom merge driversEdward Thomson2016-03-171-49/+11
| | | | | | | | Consumers can now register custom merged drivers with `git_merge_driver_register`. This allows consumers to support the merge drivers, as configured in `.gitattributes`. Consumers will be asked to perform the file-level merge when a custom driver is configured.
* diff: don't feed large files to xdiffEdward Thomson2015-10-051-2/+2
|
* merge_file: treat large files as binaryEdward Thomson2015-10-051-21/+75
| | | | | | | | xdiff craps the bed on large files. Treat very large files as binary, so that it doesn't even have to try. Refactor our merge binary handling to better match git.git, which looks for a NUL in the first 8000 bytes.
* Added options to enable patience and minimal diff driversJacques Germishuys2015-03-161-0/+6
|
* Collapse whitespace flags into git_merge_file_flags_tJacques Germishuys2015-03-161-3/+3
|
* Allow for merges with whitespace discrepanciesJacques Germishuys2015-03-161-0/+7
|
* CleanupsRussell Belfer2014-03-311-2/+2
|
* Const up members of git_merge_file_resultEdward Thomson2014-03-311-2/+2
|
* Introduce git_merge_file for consumersEdward Thomson2014-03-201-83/+180
|
* diff: rename the file's 'oid' to 'id'Carlos Martín Nieto2014-01-251-1/+1
| | | | In the same vein as the previous commits in this series.
* index: rename an entry's id to 'id'Carlos Martín Nieto2014-01-251-1/+1
| | | | This was not converted when we converted the rest, so do it now.
* Support union mergesEdward Thomson2014-01-201-0/+2
|
* Introduce diff3 mode for checking out conflictsEdward Thomson2014-01-201-0/+3
|
* merge_file should use more aggressive levelsEdward Thomson2014-01-201-4/+7
| | | | | | | | | | | The default merge_file level was XDL_MERGE_MINIMAL, which will produce conflicts where there should not be in the case where both sides were changed identically. Change the defaults to be more aggressive (XDL_MERGE_ZEALOUS) which will more aggressively compress non-conflicts. This matches git.git's defaults. Increase testing around reverting a previously reverted commit to illustrate this problem.
* checkout (from index) can write conflictsEdward Thomson2013-10-161-1/+1
|
* Fix trailing whitespacesnulltoken2013-05-151-24/+23
|
* merge!Edward Thomson2013-04-301-0/+175