summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ed863a)
raw | patch | inline | side by side (parent: 7ed863a)
author | Jeff King <peff@peff.net> | |
Sat, 19 Feb 2011 10:20:51 +0000 (05:20 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Feb 2011 18:21:26 +0000 (10:21 -0800) |
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>
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>
diff.h | patch | blob | history | |
diffcore-rename.c | patch | blob | history | |
merge-recursive.c | patch | blob | history | |
merge-recursive.h | patch | blob | history |
index 0083d92438916a8188656df140ba70d6acc8c6f6..f774c9ab51221dac3d84ec75cd7787b1c8e3e3bf 100644 (file)
--- a/diff.h
+++ b/diff.h
int pickaxe_opts;
int rename_score;
int rename_limit;
- int warn_on_too_large_rename;
+ int needed_rename_limit;
int dirstat_percent;
int setup;
int abbrev;
diff --git a/diffcore-rename.c b/diffcore-rename.c
index df41be56deab60d4d39a45920a1e62b05d0474f6..1943c46b940fd6057ac1394915ceb8f786912836 100644 (file)
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
* but handles the potential overflow case specially (and we
* assume at least 32-bit integers)
*/
+ options->needed_rename_limit = 0;
if (rename_limit <= 0 || rename_limit > 32767)
rename_limit = 32767;
if ((num_create > rename_limit && num_src > rename_limit) ||
(num_create * num_src > rename_limit * rename_limit)) {
- if (options->warn_on_too_large_rename)
- warning("too many files (created: %d deleted: %d), skipping inexact rename detection", num_create, num_src);
+ options->needed_rename_limit =
+ num_src > num_create ? num_src : num_create;
goto cleanup;
}
diff --git a/merge-recursive.c b/merge-recursive.c
index 16c2dbeab95a0f4099e3de8badf688bb4dee8189..2ecd456c28e435572916c304d432dc4dd2ca12c2 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
#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)
{
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;
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;
}
diff --git a/merge-recursive.h b/merge-recursive.h
index c8135b0ec70cc2eb92e5a6fd9353a134fda6b7bf..f0e056652f47e3e31d2d084f98b6a6b9751ad22c 100644 (file)
--- a/merge-recursive.h
+++ b/merge-recursive.h
int diff_rename_limit;
int merge_rename_limit;
int rename_score;
+ int needed_rename_limit;
int call_depth;
struct strbuf obuf;
struct string_list current_file_set;