diff options
author | Junio C Hamano <junkio@cox.net> | 2005-06-03 23:05:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-05 14:14:58 -0700 |
commit | f78c79c5d4486f47dcd69ea7fef93e84051d4496 (patch) | |
tree | f14b7a4fb10b95ff4c0d6c7aecb6f05c6b72f8aa /diffcore.h | |
parent | 49d9e85d1103fe1d0fcb73956643b93acc5c1f4f (diff) | |
download | git-f78c79c5d4486f47dcd69ea7fef93e84051d4496.tar.gz |
[PATCH] diffcore-break.c: various fixes.
This fixes three bugs in the -B heuristics.
- Although it was advertised that the initial break criteria
used was the same as what diffcore-rename uses, it was using
something different. Instead of using smaller of src and dst
size to compare with "edit" size, (insertion and deletion),
it was using larger of src and dst, unlike the rename/copy
detection logic. This caused the parameter to -B to mean
something different from the one to -M and -C. To compensate
for this change, the default break score is also changed to
match that of the default for rename/copy.
- The code would have crashed with division by zero when trying
to break an originally empty file.
- Contrary to what the comment said, the algorithm was breaking
small files, only to later merge them together.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diffcore.h')
-rw-r--r-- | diffcore.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/diffcore.h b/diffcore.h index 194d40cb48..f1b5ca748c 100644 --- a/diffcore.h +++ b/diffcore.h @@ -17,7 +17,7 @@ */ #define MAX_SCORE 60000 #define DEFAULT_RENAME_SCORE 30000 /* rename/copy similarity minimum (50%) */ -#define DEFAULT_BREAK_SCORE 59400 /* minimum for break to happen (99%)*/ +#define DEFAULT_BREAK_SCORE 30000 /* minimum for break to happen (50%)*/ #define DEFAULT_MERGE_SCORE 48000 /* maximum for break-merge to happen (80%)*/ #define MINIMUM_BREAK_SIZE 400 /* do not break a file smaller than this */ |