From 7853c5b94a148c3a5dba80a1e1f7eba6e3d79930 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Tue, 15 Jul 2014 08:57:17 +0200 Subject: [PATCH] Use recursive merge by default If two commits that are merged have more than one common predecessor the recursive merge is superior. In this situation the normal non-recursive merge may even result in broken files without notice. This is why the recursive merge should be enabled by default. Change-Id: I4c5b8b2c6d406ec925da05838696c5c57f2348ef Signed-off-by: Edwin Kempin --- Documentation/config-gerrit.txt | 2 +- .../src/main/java/com/google/gerrit/server/git/MergeUtil.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index e6415734ce..75591427bf 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -1103,7 +1103,7 @@ link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[ blog], the recursive merge produces better results if the two commits that are merged have more than one common predecessor. + -Default is false, but in a future release may default to true. +Default is true. [[database]] === Section database diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeUtil.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeUtil.java index 8902af9066..b4a1f0c17c 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeUtil.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeUtil.java @@ -86,7 +86,7 @@ public class MergeUtil { Constants.R_HEADS + Constants.MASTER; public static boolean useRecursiveMerge(Config cfg) { - return cfg.getBoolean("core", null, "useRecursiveMerge", false); + return cfg.getBoolean("core", null, "useRecursiveMerge", true); } public static interface Factory {