git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fix up diffcore-rename scoring

From
Linus Torvalds <torvalds@osdl.org>
Date
Mar 13, 2006, 07:09 UTC
Message-ID
<Pine.LNX.4.64.0603122256550.3618@g5.osdl.org>
In-Reply-To
<7vmzfusuyq.fsf@assigned-by-dhcp.cox.net>
On Sun, 12 Mar 2006, Junio C Hamano wrote:
Show 25 quoted lines
>
> Linus Torvalds <torvalds@osdl.org> writes:
> 
> > 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.

Just compare the result. Just eye-balling the difference between the rename data from 2.6.12 to 2.6.14, the fixed score actually gets better rename detection. It actually finds 133 renames (as opposed to 132 for the broken one), and the renames it finds are more sensible.

For example, the fixed version finds
	drivers/i2c/chips/lm75.h -> drivers/hwmon/lm75.h

which actually matches the other i2c/chips/ renames, while the broken one does

	drivers/i2c/chips/lm75.h -> drivers/media/video/rds.h
which just doesn't make any sense at all.

Now, that said, they _both_ find some pretty funky renames. I think there is probably some serious room for improvement, regardless (or at least changing the default similarity cut-off to something better ;)

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 13 in “Fix up diffcore-rename scoring”
  1. Linus TorvaldsMar 13, 2006
  2. Linus TorvaldsMar 13, 2006
  3. Junio C HamanoMar 13, 2006
  4. Linus TorvaldsMar 13, 2006
  5. Junio C HamanoMar 13, 2006
  6. Linus TorvaldsMar 13, 2006
  7. Junio C HamanoMar 13, 2006
  8. Linus TorvaldsMar 13, 2006
  9. Rutger NijlunsingMar 14, 2006
  10. Junio C HamanoMar 14, 2006
  11. Geert BoschApr 6, 2006
  12. Junio C HamanoApr 11, 2006
  13. Geert BoschApr 14, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.