summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 88b5a74)
raw | patch | inline | side by side (parent: 88b5a74)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 21 Nov 2005 20:18:23 +0000 (12:18 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 21 Nov 2005 20:21:24 +0000 (12:21 -0800) |
When the user is interested in pure renames, there is no point
doing the similarity scores. This changes the score argument
parsing to special case -M100 (otherwise, it is a precision
scaled value 0 <= v < 1 and would mean 0.1, not 1.0 --- if you
do mean 0.1, you can say -M1), and optimizes the diffcore_rename
transformation to only look at pure renames in that case.
Signed-off-by: Junio C Hamano <junkio@cox.net>
doing the similarity scores. This changes the score argument
parsing to special case -M100 (otherwise, it is a precision
scaled value 0 <= v < 1 and would mean 0.1, not 1.0 --- if you
do mean 0.1, you can say -M1), and optimizes the diffcore_rename
transformation to only look at pure renames in that case.
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history | |
diffcore-rename.c | patch | blob | history |
index 0391e8c42336cda9c83eeb1b9ac8f1378e4a43f9..0f839c11b7efef344d8f695842ce48120c565a68 100644 (file)
--- a/diff.c
+++ b/diff.c
}
*cp_p = cp;
+ /* special case: -M100 would mean 1.0 not 0.1 */
+ if (num == 100 && scale == 1000)
+ return MAX_SCORE;
+
/* user says num divided by scale and we say internally that
* is MAX_SCORE * num / scale.
*/
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 6a9d95d0593f26c5e698c5e593a9efc287c8e399..dba965c0b4006251b1da04465d319c5fe9997ea4 100644 (file)
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
if (rename_count == rename_dst_nr)
goto cleanup;
+ if (minimum_score == MAX_SCORE)
+ goto cleanup;
+
num_create = (rename_dst_nr - rename_count);
num_src = rename_src_nr;
mx = xmalloc(sizeof(*mx) * num_create * num_src);