Git development
 help / color / mirror / Atom feed
* [PATCH 8/8] Removes support for O(n^2) algorithm from git-rev-list completely
@ 2005-07-01  6:46 Jon Seymour
  0 siblings, 0 replies; only message in thread
From: Jon Seymour @ 2005-07-01  6:46 UTC (permalink / raw)
  To: git; +Cc: torvalds, jon.seymour


This patch completely removes support for the O(n^2) bisection
algorithm from commit.c, commit.h and rev-list.c

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
Linus: I have included this patch to allow you to easily remove the O(n^2)
algorithm if that is your choice. I am not expecting you to do so.
---

 commit.c                   |   31 -------------------------------
 commit.h                   |    7 -------
 rev-list.c                 |    7 -------
 t/t6002-rev-list-bisect.sh |    1 -
 4 files changed, 0 insertions(+), 46 deletions(-)

fa36c577acce519d1ef17bd807ab1486e1aa365a
diff --git a/commit.c b/commit.c
--- a/commit.c
+++ b/commit.c
@@ -504,37 +504,6 @@ static void clear_distance(struct commit
 	}
 }
 
-struct commit_list *find_bisection(struct commit_list *list)
-{
-	int nr, closest;
-	struct commit_list *p, *best;
-
-	nr = 0;
-	p = list;
-	while (p) {
-		nr++;
-		p = p->next;
-	}
-	closest = 0;
-	best = list;
-
-	p = list;
-	while (p) {
-		int distance = count_distance(p);
-		clear_distance(list);
-		if (nr - distance < distance)
-			distance = nr - distance;
-		if (distance > closest) {
-			best = p;
-			closest = distance;
-		}
-		p = p->next;
-	}
-	if (best)
-		best->next = NULL;
-	return best;
-}
-
 static inline struct bisect_by_cut_node * get_bisect_by_cut_node(struct commit * commit)
 {
 	return (struct bisect_by_cut_node *)commit->object.util;
diff --git a/commit.h b/commit.h
--- a/commit.h
+++ b/commit.h
@@ -74,13 +74,6 @@ int count_parents(struct commit * commit
 void sort_in_topological_order(struct commit_list ** list);
 
 /*
- * Uses an O(n^2) algorithm to find the commit that bisects 
- * the subgraph represented by the list of commits. The boundaries
- * of the subgraph are delimited by adjacent nodes that have
- */
-struct commit_list *find_bisection(struct commit_list *list);
-
-/*
  * Uses O(n) to find the bisection of a list of commits
  * which is already sorted in topological order.
  */
diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -19,7 +19,6 @@ static const char rev_list_usage[] =
                       "  --bisect\n"
 		      "  --merge-order [ --show-breaks ]";
 
-static int bisect_list = 0;
 static int tag_objects = 0;
 static int tree_objects = 0;
 static int blob_objects = 0;
@@ -252,8 +251,6 @@ struct commit_list *limit_list(struct co
 		}
 		p = &commit_list_insert(commit, p)->next;
 	}
-	if (bisect_list)
-		newlist = find_bisection(newlist);
 	return newlist;
 }
 
@@ -370,10 +367,6 @@ int main(int argc, char **argv)
 			bisect_by_cut_option = 1;
 			continue;
 		}
-		if (!strcmp(arg, "--bisect-orig")) {
-			bisect_list = 1;
-			continue;
-		}
 		if (!strcmp(arg, "--objects")) {
 			tag_objects = 1;
 			tree_objects = 1;
diff --git a/t/t6002-rev-list-bisect.sh b/t/t6002-rev-list-bisect.sh
--- a/t/t6002-rev-list-bisect.sh
+++ b/t/t6002-rev-list-bisect.sh
@@ -241,7 +241,6 @@ EOF
 }
 
 test_sequence "--bisect"
-test_sequence "--bisect-by-cut"
 
 #
 #
------------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-01  6:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-01  6:46 [PATCH 8/8] Removes support for O(n^2) algorithm from git-rev-list completely Jon Seymour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox