From: Davide Libenzi <davidel@xmailserver.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [RFH] xdiff shows trivially redundant diff.
Date: Sun, 2 Apr 2006 20:26:52 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0604022022390.10401@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0604021749580.23419@g5.osdl.org>
On Sun, 2 Apr 2006, Linus Torvalds wrote:
>
>
> On Sun, 2 Apr 2006, Davide Libenzi wrote:
>>
>> 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?
It does ;) If you make the second hunk (the one with the '') line) to be
the first, the shrink-initial-and-final lines optimizations will make it
eat the '') line.
> 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..
Tomorrow I'll take a look at it.
- Davide
next prev parent reply other threads:[~2006-04-03 3:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-02 9:15 [RFH] xdiff shows trivially redundant diff Junio C Hamano
2006-04-02 17:35 ` Davide Libenzi
2006-04-02 21:02 ` Junio C Hamano
2006-04-02 21:16 ` Linus Torvalds
2006-04-02 22:18 ` Davide Libenzi
2006-04-02 22:14 ` Davide Libenzi
2006-04-03 0:52 ` Linus Torvalds
2006-04-03 3:26 ` Davide Libenzi [this message]
2006-04-03 4:19 ` Linus Torvalds
2006-04-03 4:30 ` Davide Libenzi
2006-04-03 7:33 ` Junio C Hamano
2006-04-03 19:33 ` Davide Libenzi
2006-04-03 19:42 ` Davide Libenzi
2006-04-03 20:01 ` Junio C Hamano
2006-04-03 22:50 ` Davide Libenzi
2006-04-03 23:29 ` Davide Libenzi
2006-04-04 1:55 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0604022022390.10401@alien.or.mcafeemobile.com \
--to=davidel@xmailserver.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).