git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/5] bisect: move common bisect functionality in "bisect_common"

From
Christian Couder <chriscool@tuxfamily.org>
Date
Apr 19, 2009, 09:55 UTC
Message-ID
<20090419115557.58efa4fe.chriscool@tuxfamily.org>
So we can easily reuse the code in a later patch.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 bisect.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/bisect.c b/bisect.c
index 58f7e6f..0448eae 100644
--- a/bisect.c
+++ b/bisect.c
@@ -532,6 +532,20 @@ static void bisect_rev_setup(struct rev_info *revs, const char *prefix)
 	revs->limited = 1;
 }
 
+static void bisect_common(struct rev_info *revs, const char *prefix,
+			  int *reaches, int *all)
+{
+	bisect_rev_setup(revs, prefix);
+
+	if (prepare_revision_walk(revs))
+		die("revision walk setup failed");
+	if (revs->tree_objects)
+		mark_edges_uninteresting(revs->commits, revs, NULL);
+
+	revs->commits = find_bisection(revs->commits, reaches, all,
+				       !!skipped_sha1_nr);
+}
+
 int bisect_next_vars(const char *prefix)
 {
 	struct rev_info revs;
@@ -542,15 +556,7 @@ int bisect_next_vars(const char *prefix)
 	info.revs = &revs;
 	info.bisect_show_flags = BISECT_SHOW_TRIED | BISECT_SHOW_STRINGED;
 
-	bisect_rev_setup(&revs, prefix);
-
-	if (prepare_revision_walk(&revs))
-		die("revision walk setup failed");
-	if (revs.tree_objects)
-		mark_edges_uninteresting(revs.commits, &revs, NULL);
-
-	revs.commits = find_bisection(revs.commits, &reaches, &all,
-				      !!skipped_sha1_nr);
+	bisect_common(&revs, prefix, &reaches, &all);
 
 	return show_bisect_vars(&info, reaches, all);
 }
-- 
1.6.2.2.537.g3b83b
Message 1 of 1 in “bisect: move common bisect functionality in "bisect_common"”
  1. 3/5 bisect: move common bisect functionality in "bisect_common"Christian Couder, Apr 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.