summaryrefslogtreecommitdiff
path: root/merge-ort.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2020-12-16 22:28:02 +0000
committerJunio C Hamano <gitster@pobox.com>2020-12-16 21:56:39 -0800
commit8119214f4e7036cef01a8e13f161ec510b3ff710 (patch)
treeaf9ef47412aaf52ae1dd84c9d13ea17cb5481a7e /merge-ort.h
parent43e9c4eeccc069dbe6ca8a65dc5d0093b46acc03 (diff)
downloadgit-8119214f4e7036cef01a8e13f161ec510b3ff710.tar.gz
merge-ort: implement merge_incore_recursive()
Implement merge_incore_recursive(), mostly through the use of a new helper function, merge_ort_internal(), which itself is based off merge_recursive_internal() from merge-recursive.c. This drops the number of failures in the testsuite when run under GIT_TEST_MERGE_ALGORITHM=ort from around 1500 to 647. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ort.h')
-rw-r--r--merge-ort.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/merge-ort.h b/merge-ort.h
index 55ae7ee865..d53a0a339f 100644
--- a/merge-ort.h
+++ b/merge-ort.h
@@ -34,6 +34,16 @@ struct merge_result {
/*
* rename-detecting three-way merge with recursive ancestor consolidation.
* working tree and index are untouched.
+ *
+ * merge_bases will be consumed (emptied) so make a copy if you need it.
+ *
+ * NOTE: empirically, the recursive algorithm will perform better if you
+ * pass the merge_bases in the order of oldest commit to the
+ * newest[1][2].
+ *
+ * [1] https://lore.kernel.org/git/nycvar.QRO.7.76.6.1907252055500.21907@tvgsbejvaqbjf.bet/
+ * [2] commit 8918b0c9c2 ("merge-recur: try to merge older merge bases
+ * first", 2006-08-09)
*/
void merge_incore_recursive(struct merge_options *opt,
struct commit_list *merge_bases,