Re: [RFH] xdiff shows trivially redundant diff.
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Apr 3, 2006, 00:52 UTC
- Message-ID
- <Pine.LNX.4.64.0604021749580.23419@g5.osdl.org>
- In-Reply-To
- <Pine.LNX.4.64.0604021454560.30205@alien.or.mcafeemobile.com>
On Sun, 2 Apr 2006, Davide Libenzi wrote:
Show 10 quoted lines
> > Yes, it does even vanilla libxdiff ;) It's not a problem though, since it is > created in xdl_cleanup_records() that tries to do a fast pass over the records > to try to simplify the real diff operation. In trying to be fast, only hashes > are compared, and it happens that the hash for "'')" collides with another one > (try to replace one of the "'')" chars with another one). Why is this not a > problem? Because what this lead to is only lines to be marked as changed, with > a probability of about N/2^(8 * sizeof(long) - 1), even though they are not. > And this happens only during sequential groups of lines changed, that is when > the hash-colliding line is either at the begin or the end of the run.
Hmm. It's still ugly, though. No possibility to have a "clean up identical initial and final lines" stage to get rid of extraneous bogus diffs?
I look at diffs a lot, and while this may be rare, if I were to end up having to wonder what the difference is and it turns out that it's just due to a libxdelta thing, I'd be a bit irritated and wish it gave me a proper diff..
Linus