From 8c912eea94a2138e8bc608f7c390eb0b313effb0 Mon Sep 17 00:00:00 2001 From: Tay Ray Chuan Date: Tue, 12 Jul 2011 14:10:25 +0800 Subject: teach --histogram to diff Port JGit's HistogramDiff algorithm over to C. Rough numbers (TODO) show that it is faster than its --patience cousin, as well as the default Meyers algorithm. The implementation has been reworked to use structs and pointers, instead of bitmasks, thus doing away with JGit's 2^28 line limit. We also use xdiff's default hash table implementation (xdl_hash_bits() with XDL_HASHLONG()) for convenience. Signed-off-by: Tay Ray Chuan Signed-off-by: Junio C Hamano --- xdiff/xdiffi.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xdiff/xdiffi.c') diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index da67c04357..75a3922750 100644 --- a/xdiff/xdiffi.c +++ b/xdiff/xdiffi.c @@ -331,6 +331,9 @@ int xdl_do_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, if (xpp->flags & XDF_PATIENCE_DIFF) return xdl_do_patience_diff(mf1, mf2, xpp, xe); + if (xpp->flags & XDF_HISTOGRAM_DIFF) + return xdl_do_histogram_diff(mf1, mf2, xpp, xe); + if (xdl_prepare_env(mf1, mf2, xpp, xe) < 0) { return -1; -- cgit v1.2.3