aboutsummaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-01-06 13:50:06 -0800
committerJunio C Hamano <gitster@pobox.com>2011-03-22 14:29:07 -0700
commitf31027c99cb2ec4eb7ad8d1ebc7f0e20fef4bd1d (patch)
treeecc4d0213fcbd8c270b254cec1caff867034ac7d /builtin/log.c
parente88d6bc6f90059f6e87f6d51eba83ec15e4eecc9 (diff)
downloadgit-f31027c99cb2ec4eb7ad8d1ebc7f0e20fef4bd1d.tar.gz
git-f31027c99cb2ec4eb7ad8d1ebc7f0e20fef4bd1d.tar.xz
diffcore-rename: fall back to -C when -C -C busts the rename limit
When there are too many paths in the project, the number of rename source candidates "git diff -C -C" finds will exceed the rename detection limit, and no inexact rename detection is performed. We however could fall back to "git diff -C" if the number of modified paths is sufficiently small. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 796e9e574..707fd5706 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -247,6 +247,8 @@ static void finish_early_output(struct rev_info *rev)
static int cmd_log_walk(struct rev_info *rev)
{
struct commit *commit;
+ int saved_nrl = 0;
+ int saved_dcctc = 0;
if (rev->early_output)
setup_early_output(rev);
@@ -277,7 +279,14 @@ static int cmd_log_walk(struct rev_info *rev)
}
free_commit_list(commit->parents);
commit->parents = NULL;
+ if (saved_nrl < rev->diffopt.needed_rename_limit)
+ saved_nrl = rev->diffopt.needed_rename_limit;
+ if (rev->diffopt.degraded_cc_to_c)
+ saved_dcctc = 1;
}
+ rev->diffopt.degraded_cc_to_c = saved_dcctc;
+ rev->diffopt.needed_rename_limit = saved_nrl;
+
if (rev->diffopt.output_format & DIFF_FORMAT_CHECKDIFF &&
DIFF_OPT_TST(&rev->diffopt, CHECK_FAILED)) {
return 02;