Re: [PATCH 1/3] rev-list: implement --bisect-all

Previous thread: bug? - git-checkout treeish paths ignores deleted files by Mark Levedahl on Monday, October 8, 2007 - 5:58 pm. (4 messages)

Next thread: [PATCH 2/3] Bisect: fix some white spaces and empty lines breakages. by Christian Couder on Monday, October 8, 2007 - 9:25 pm. (1 message)
From: Christian Couder
Date: Monday, October 8, 2007 - 9:25 pm

This is Junio's patch with some stuff to make --bisect-all
compatible with --bisect-vars.

This option makes it possible to see all the potential
bisection points. The best ones are displayed first.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 builtin-rev-list.c |  100 ++++++++++++++++++++++++++++++++++++++++++++-------
 log-tree.c         |    2 +-
 log-tree.h         |    1 +
 3 files changed, 88 insertions(+), 15 deletions(-)

	There is a a small change in the second hunk 
	compared to the patch I sent yesterday.

diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 33726b8..4439332 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -9,6 +9,7 @@
 #include "revision.h"
 #include "list-objects.h"
 #include "builtin.h"
+#include "log-tree.h"
 
 /* bits #0-15 in revision.h */
 
@@ -38,7 +39,8 @@ static const char rev_list_usage[] =
 "    --left-right\n"
 "  special purpose:\n"
 "    --bisect\n"
-"    --bisect-vars"
+"    --bisect-vars\n"
+"    --bisect-all"
 ;
 
 static struct rev_info revs;
@@ -74,6 +76,7 @@ static void show_commit(struct commit *commit)
 			parents = parents->next;
 		}
 	}
+	show_decorations(commit);
 	if (revs.commit_format == CMIT_FMT_ONELINE)
 		putchar(' ');
 	else
@@ -278,6 +281,57 @@ static struct commit_list *best_bisection(struct commit_list *list, int nr)
 	return best;
 }
 
+struct commit_dist {
+	struct commit *commit;
+	int distance;
+};
+
+static int compare_commit_dist(const void *a_, const void *b_)
+{
+	struct commit_dist *a, *b;
+
+	a = (struct commit_dist *)a_;
+	b = (struct commit_dist *)b_;
+	if (a->distance != b->distance)
+		return b->distance - a->distance; /* desc sort */
+	return hashcmp(a->commit->object.sha1, b->commit->object.sha1);
+}
+
+static struct commit_list *best_bisection_sorted(struct commit_list *list, int nr)
+{
+	struct commit_list *p;
+	struct commit_dist *array = xcalloc(nr, sizeof(*array));
+	int cnt, i;
+
+	for (p = list, cnt = 0; p; p = ...
From: Frank Lichtenheld
Date: Tuesday, October 9, 2007 - 3:04 am

The whole series is missing patches for the manual pages.

Just saying.

Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/
-

Previous thread: bug? - git-checkout treeish paths ignores deleted files by Mark Levedahl on Monday, October 8, 2007 - 5:58 pm. (4 messages)

Next thread: [PATCH 2/3] Bisect: fix some white spaces and empty lines breakages. by Christian Couder on Monday, October 8, 2007 - 9:25 pm. (1 message)