Git 2.45-rc1
[git.git] / Documentation / technical / api-merge.txt
blobc2ba01828c6b01b258d4d77d46714db3fafb6e0a
1 merge API
2 =========
4 The merge API helps a program to reconcile two competing sets of
5 improvements to some files (e.g., unregistered changes from the work
6 tree versus changes involved in switching to a new branch), reporting
7 conflicts if found.  The library called through this API is
8 responsible for a few things.
10  * determining which trees to merge (recursive ancestor consolidation);
12  * lining up corresponding files in the trees to be merged (rename
13    detection, subtree shifting), reporting edge cases like add/add
14    and rename/rename conflicts to the user;
16  * performing a three-way merge of corresponding files, taking
17    path-specific merge drivers (specified in `.gitattributes`)
18    into account.
20 Data structures
21 ---------------
23 * `mmbuffer_t`, `mmfile_t`
25 These store data usable for use by the xdiff backend, for writing and
26 for reading, respectively.  See `xdiff/xdiff.h` for the definitions
27 and `diff.c` for examples.
29 * `struct ll_merge_options`
31 Check merge-ll.h for details.
33 Low-level (single file) merge
34 -----------------------------
36 Check merge-ll.h for details.