Re: [PATCH 1/3 v2] Implement the patience diff algorithm

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Schindelin
Date: Friday, January 2, 2009 - 2:59 pm

Hi,

The interdiff between v1 and v2 of PATCH 1/3.  As you can see, I also 
added a cleanup of an intermediate xdlenv.

Ciao,
Dscho

 xdiff/xpatience.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xdiff/xpatience.c b/xdiff/xpatience.c
index 6687940..d01cbdd 100644
--- a/xdiff/xpatience.c
+++ b/xdiff/xpatience.c
@@ -309,6 +309,8 @@ static int fall_back_to_classic_diff(struct hashmap *map,
 	memcpy(map->env->xdf1.rchg + line1 - 1, env.xdf1.rchg, count1);
 	memcpy(map->env->xdf2.rchg + line2 - 1, env.xdf2.rchg, count2);
 
+	xdl_free_env(&env);
+
 	return 0;
 }
 
@@ -368,6 +370,15 @@ int xdl_do_patience_diff(mmfile_t *file1, mmfile_t *file2,
 	if (xdl_prepare_env(file1, file2, xpp, env) < 0)
 		return -1;
 
+	/*
+	 * It is a pity that xdl_cleanup_records() not only marks those
+	 * lines as changes that are only present in one file, but also
+	 * lines that have multiple matches and happen to be in a "run
+	 * of discardable lines" that patience diff happens to split
+	 * differently.
+	 */
+	memset(env->xdf1.rchg, 0, env->xdf1.nrec);
+	memset(env->xdf2.rchg, 0, env->xdf2.nrec);
 	/* environment is cleaned up in xdl_diff() */
 	return patience_diff(file1, file2, xpp, env,
 			1, env->xdf1.nrec, 1, env->xdf2.nrec);
-- 
1.6.1.rc3.224.g95ac9


--
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
libxdiff and patience diff, Pierre Habouzit, (Mon Nov 3, 5:40 pm)
Re: libxdiff and patience diff, Davide Libenzi, (Mon Nov 3, 8:17 pm)
Re: libxdiff and patience diff, Johannes Schindelin, (Mon Nov 3, 10:39 pm)
Re: libxdiff and patience diff, Pierre Habouzit, (Tue Nov 4, 1:30 am)
Re: libxdiff and patience diff, Pierre Habouzit, (Tue Nov 4, 1:33 am)
Re: libxdiff and patience diff, Johannes Schindelin, (Tue Nov 4, 7:34 am)
Re: libxdiff and patience diff, Pierre Habouzit, (Tue Nov 4, 8:23 am)
Re: libxdiff and patience diff, Johannes Schindelin, (Tue Nov 4, 8:57 am)
Re: libxdiff and patience diff, Pierre Habouzit, (Tue Nov 4, 9:15 am)
[PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Thu Jan 1, 9:38 am)
[PATCH 1/3] Implement the patience diff algorithm, Johannes Schindelin, (Thu Jan 1, 9:38 am)
[PATCH 2/3] Introduce the diff option '--patience', Johannes Schindelin, (Thu Jan 1, 9:39 am)
[PATCH 3/3] bash completions: Add the --patience option, Johannes Schindelin, (Thu Jan 1, 9:39 am)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Clemens Buchacher, (Fri Jan 2, 3:55 am)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Clemens Buchacher, (Fri Jan 2, 3:58 am)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Fri Jan 2, 11:17 am)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Fri Jan 2, 11:46 am)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Fri Jan 2, 12:07 pm)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Fri Jan 2, 12:22 pm)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Fri Jan 2, 2:59 pm)
[PATCH 1/3 v2] Implement the patience diff algorithm, Johannes Schindelin, (Fri Jan 2, 2:59 pm)
Re: [PATCH 1/3 v2] Implement the patience diff algorithm, Johannes Schindelin, (Fri Jan 2, 2:59 pm)
Bazaar's patience diff as GIT_EXTERNAL_DIFF, Adeodato , (Sat Jan 3, 9:24 am)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Tue Jan 6, 12:40 pm)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Wed Jan 7, 10:01 am)
[PATCH v3 1/3] Implement the patience diff algorithm, Johannes Schindelin, (Wed Jan 7, 10:04 am)
Re: [PATCH v3 1/3] Implement the patience diff algorithm, Davide Libenzi, (Wed Jan 7, 11:10 am)
Re: [PATCH v3 1/3] Implement the patience diff algorithm, Johannes Schindelin, (Wed Jan 7, 11:32 am)
Re: [PATCH v3 1/3] Implement the patience diff algorithm, Linus Torvalds, (Wed Jan 7, 11:59 am)
Re: [PATCH v3 1/3] Implement the patience diff algorithm, Johannes Schindelin, (Wed Jan 7, 1:00 pm)
Re: [PATCH v3 1/3] Implement the patience diff algorithm, Davide Libenzi, (Wed Jan 7, 1:09 pm)
Re: [PATCH v3 1/3] Implement the patience diff algorithm, Davide Libenzi, (Wed Jan 7, 1:11 pm)
Re: [PATCH v3 1/3] Implement the patience diff algorithm, Johannes Schindelin, (Wed Jan 7, 1:19 pm)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Wed Jan 7, 1:38 pm)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Wed Jan 7, 3:00 pm)
Re: [PATCH 0/3] Teach Git about the patience diff algorithm, Johannes Schindelin, (Wed Jan 7, 4:03 pm)