summaryrefslogtreecommitdiff
path: root/diffcore-rename.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-19 23:23:56 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-19 23:23:56 -0700
commit0ce6a51b43815a34d0dbebaa799b32a83d1ea4f9 (patch)
tree999ed87a9453af4848bf98a3341ceaf0801c6f95 /diffcore-rename.c
parentedf9d719d1d05c1eb4f652782febfdfede212648 (diff)
parentbebd2fd77d385f198017fe297a6c79e26b2bf61c (diff)
downloadgit-0ce6a51b43815a34d0dbebaa799b32a83d1ea4f9.tar.gz
Merge branch 'jk/merge-rename-ux'
* jk/merge-rename-ux: pull: propagate --progress to merge merge: enable progress reporting for rename detection add inexact rename detection progress infrastructure commit: stop setting rename limit bump rename limit defaults (again) merge: improve inexact rename limit warning
Diffstat (limited to 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 0cd4c1305b..d40e40a3ac 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -5,6 +5,7 @@
#include "diff.h"
#include "diffcore.h"
#include "hash.h"
+#include "progress.h"
/* Table of rename/copy destinations */
@@ -449,6 +450,7 @@ void diffcore_rename(struct diff_options *options)
struct diff_score *mx;
int i, j, rename_count;
int num_create, num_src, dst_cnt;
+ struct progress *progress = NULL;
if (!minimum_score)
minimum_score = DEFAULT_RENAME_SCORE;
@@ -518,15 +520,22 @@ void diffcore_rename(struct diff_options *options)
* 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;
}
+ if (options->show_rename_progress) {
+ progress = start_progress_delay(
+ "Performing inexact rename detection",
+ rename_dst_nr * rename_src_nr, 50, 1);
+ }
+
mx = xcalloc(num_create * NUM_CANDIDATE_PER_DST, sizeof(*mx));
for (dst_cnt = i = 0; i < rename_dst_nr; i++) {
struct diff_filespec *two = rename_dst[i].two;
@@ -556,7 +565,9 @@ void diffcore_rename(struct diff_options *options)
diff_free_filespec_blob(two);
}
dst_cnt++;
+ display_progress(progress, (i+1)*rename_src_nr);
}
+ stop_progress(&progress);
/* cost matrix sorted by most to least similar pair */
qsort(mx, dst_cnt * NUM_CANDIDATE_PER_DST, sizeof(*mx), score_compare);