Re: [PATCH] Fix -B "very-different" logic.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-06-03 10:21:43
On Thu, 2 Jun 2005, Junio C Hamano wrote:
> 
> However I think the diffcore-break algorithm itself was basing
> its "very_different" computation on numbers somewhat bogus.  It
> was counting newly inserted bytes into account, but amount of
> those bytes should not make any difference when determining if
> the change is a complete rewrite.

Careful. 

I think the amount of new code _should_ matter. Otherwise, an old empty
file would always be considered the source of a new file, since the diff 
doesn't remove anything. Similarly, just because we have a boilerplate 
file shouldn't make that always be considered a "wonderful source", when 
people add the real meat to it.

So I think you're on the right track, but I don't think you should
entirely dismiss "lots of stuff added" as a reason for a "break". I think
that if the new stuff is _much_ larger than the old stuff, it might as
well be considered a rewrite.

In particular, let's say that I used to have two files:

	a.c - small helper functions
	b.c - the "meat" of the thing

and I end up deciding that I might as well collapse it all into one file, 
a.c. What happens? There's almost no deletes from a.c, but there's a lot 
of new code in it. 

Wouldn't it be _better_ if you considered the new "a.c" a new file, so 
that you might notice that it's actually _closer_ to the old removed "b.c" 
than the old "a.c"?

See what I'm saying?

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Jun 03 10:20:04 2005

This archive was generated by hypermail 2.1.8 : 2005-06-03 10:20:05 EST