Re: Fix up diffcore-rename scoring
- From
Junio C Hamano <junkio@cox.net>
- Date
- Mar 13, 2006, 06:46 UTC
- Message-ID
- <7vmzfusuyq.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0603122223160.3618@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 10 quoted lines
> The "score" calculation for diffcore-rename was totally broken. > > It scaled "score" as > > score = src_copied * MAX_SCORE / dst->size; > > which means that you got a 100% similarity score even if src and dest were > different, if just every byte of dst was copied from src, even if source > was much larger than dst (eg we had copied 85% of the bytes, but _deleted_ > the remaining 15%).
Your reading of the code is correct, but that is deliberate.
> /* How similar are they? > * what percentage of material in dst are from source? > */
I wanted to say in such a case that dst was _really_ derived from the source. I think using max may make more sense, but I need to convince myself by looking at filepairs that this change stops detecting as renames, and this change starts detecting as renames.