aboutsummaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-02-19 05:20:51 -0500
committerJunio C Hamano <gitster@pobox.com>2011-02-21 10:21:26 -0800
commitbf0ab10fa84df6c49450a06077d1c52756d88222 (patch)
tree0722540155c202e474b59de2fa41db1e740a4bbd /merge-recursive.c
parent7ed863a85a6ce2c4ac4476848310b8f917ab41f9 (diff)
downloadgit-bf0ab10fa84df6c49450a06077d1c52756d88222.tar.gz
git-bf0ab10fa84df6c49450a06077d1c52756d88222.tar.xz
merge: improve inexact rename limit warning
The warning is generated deep in the diffcore code, which means that it will come first, followed possibly by a spew of conflicts, making it hard to see. Instead, let's have diffcore pass back the information about how big the rename limit would needed to have been, and then the caller can provide a more appropriate message (and at a more appropriate time). No refactoring of other non-merge callers is necessary, because nobody else was even using the warn_on_rename_limit feature. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 16c2dbeab..2ecd456c2 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -22,6 +22,11 @@
#include "dir.h"
#include "submodule.h"
+static const char rename_limit_advice[] =
+"inexact rename detection was skipped because there were too many\n"
+" files. You may want to set your merge.renamelimit variable to at least\n"
+" %d and retry this merge.";
+
static struct tree *shift_tree_object(struct tree *one, struct tree *two,
const char *subtree_shift)
{
@@ -436,12 +441,13 @@ static struct string_list *get_renames(struct merge_options *o,
o->diff_rename_limit >= 0 ? o->diff_rename_limit :
500;
opts.rename_score = o->rename_score;
- opts.warn_on_too_large_rename = 1;
opts.output_format = DIFF_FORMAT_NO_OUTPUT;
if (diff_setup_done(&opts) < 0)
die("diff setup failed");
diff_tree_sha1(o_tree->object.sha1, tree->object.sha1, "", &opts);
diffcore_std(&opts);
+ if (opts.needed_rename_limit > o->needed_rename_limit)
+ o->needed_rename_limit = opts.needed_rename_limit;
for (i = 0; i < diff_queued_diff.nr; ++i) {
struct string_list_item *item;
struct rename *re;
@@ -1666,6 +1672,8 @@ int merge_recursive(struct merge_options *o,
commit_list_insert(h2, &(*result)->parents->next);
}
flush_output(o);
+ if (o->needed_rename_limit)
+ warning(rename_limit_advice, o->needed_rename_limit);
return clean;
}