Skip to content

Commit d1e8f30

Browse files
newrengitster
authored andcommitted
merge-ort: allow rename detection to be disabled
When merge-ort was written, I did not at first allow rename detection to be disabled, because I suspected that most folks disabling rename detection were doing so solely for performance reasons. Since I put a lot of working into providing dramatic speedups for rename detection performance as used by the merge machinery, I wanted to know if there were still real world repositories where rename detection was problematic from a performance perspective. We have had years now to collect such information, and while we never received one, waiting longer with the option disabled seems unlikely to help surface such issues at this point. Also, there has been at least one request to allow rename detection to be disabled for behavioral rather than performance reasons, so let's start heeding the config and command line settings. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6311e1a commit d1e8f30

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Documentation/merge-strategies.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ find-renames[=<n>];;
8282
rename-threshold=<n>;;
8383
Deprecated synonym for `find-renames=<n>`.
8484

85+
no-renames;;
86+
Turn off rename detection. This overrides the `merge.renames`
87+
configuration variable.
88+
See also linkgit:git-diff[1] `--no-renames`.
89+
8590
subtree[=<path>];;
8691
This option is a more advanced form of 'subtree' strategy, where
8792
the strategy makes a guess on how two trees must be shifted to
@@ -107,7 +112,7 @@ For a path that is a submodule, the same caution as 'ort' applies to this
107112
strategy.
108113
+
109114
The 'recursive' strategy takes the same options as 'ort'. However,
110-
there are three additional options that 'ort' ignores (not documented
115+
there are two additional options that 'ort' ignores (not documented
111116
above) that are potentially useful with the 'recursive' strategy:
112117

113118
patience;;
@@ -121,11 +126,6 @@ diff-algorithm=[patience|minimal|histogram|myers];;
121126
specifically uses `diff-algorithm=histogram`, while `recursive`
122127
defaults to the `diff.algorithm` config setting.
123128

124-
no-renames;;
125-
Turn off rename detection. This overrides the `merge.renames`
126-
configuration variable.
127-
See also linkgit:git-diff[1] `--no-renames`.
128-
129129
resolve::
130130
This can only resolve two heads (i.e. the current branch
131131
and another branch you pulled from) using a 3-way merge

merge-ort.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,6 +3448,11 @@ static int detect_and_process_renames(struct merge_options *opt)
34483448

34493449
if (!possible_renames(renames))
34503450
goto cleanup;
3451+
if (opt->detect_renames == 0) {
3452+
renames->redo_after_renames = 0;
3453+
renames->cached_pairs_valid_side = 0;
3454+
goto cleanup;
3455+
}
34513456

34523457
trace2_region_enter("merge", "regular renames", opt->repo);
34533458
detection_run |= detect_regular_renames(opt, MERGE_SIDE1);

0 commit comments

Comments
 (0)