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

[PATCH 2/2] Fix git rev-list --bisect and git bisect visualize when the bisection is done in old/new mode.

From
LSLouis Stuber <stuberl@ensimag.grenoble-inp.fr>
Date
Jun 5, 2015, 16:34 UTC
Message-ID
<1433522061-14532-2-git-send-email-stuberl@ensimag.grenoble-inp.fr>
In-Reply-To
<1433522061-14532-1-git-send-email-stuberl@ensimag.grenoble-inp.fr>
Signed-off-by: Louis Stuber <stuberl@ensimag.grenoble-inp.fr>
Signed-off-by: Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr>
---
 revision.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/revision.c b/revision.c
index 7ddbaa0..b631596 100644
--- a/revision.c
+++ b/revision.c
@@ -2075,12 +2075,23 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
 
 static int for_each_bad_bisect_ref(const char *submodule, each_ref_fn fn, void *cb_data)
 {
-	return for_each_ref_in_submodule(submodule, "refs/bisect/bad", fn, cb_data);
+	/*
+	 * if BISECT_OLDNEWMODE exists, this is an old/new bisect and the path is different
+	 */
+	struct stat st;
+	if (stat(git_path("BISECT_OLDNEWMODE"), &st))
+		return for_each_ref_in_submodule(submodule, "refs/bisect/bad", fn, cb_data);
+	else
+		return for_each_ref_in_submodule(submodule, "refs/bisect/new", fn, cb_data);
 }
 
 static int for_each_good_bisect_ref(const char *submodule, each_ref_fn fn, void *cb_data)
 {
-	return for_each_ref_in_submodule(submodule, "refs/bisect/good", fn, cb_data);
+	struct stat st;
+	if (stat(git_path("BISECT_OLDNEWMODE"), &st))
+		return for_each_ref_in_submodule(submodule, "refs/bisect/good", fn, cb_data);
+	else
+		return for_each_ref_in_submodule(submodule, "refs/bisect/old", fn, cb_data);
 }
 
 static int handle_revision_pseudo_opt(const char *submodule,
-- 
1.7.1
Previous: Louis StuberNext: Eric Sunshine
Message 2 of 8 in “git-bisect.sh : create a file if the bisection is in old/new mode, named "BISECT_OLDNEWMODE", so it can easily be seen outside the program without having to read BISECT_TERMS. This will have to be changed in further versions if new terms are introduced.”
  1. 1/2 git-bisect.sh : create a file if the bisection is in old/new mode, named "BISECT_OLDNEWMODE", so it can easily be seen outside the program without having to read BISECT_TERMS. This will have to be changed in further versions if new terms are introduced.Louis Stuber, Jun 5, 2015
  2. 2/2 Fix git rev-list --bisect and git bisect visualize when the bisection is done in old/new mode.Louis Stuber, Jun 5, 2015
  3. Eric SunshineJun 5, 2015
  4. Eric SunshineJun 5, 2015
  5. Matthieu MoyJun 8, 2015
  6. Christian CouderJun 5, 2015
  7. Louis-Alexandre StuberJun 7, 2015
  8. Matthieu MoyJun 8, 2015

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.