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

Re: Add '--bisect' revision machinery argument

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 28, 2009, 23:07 UTC
Message-ID
<7viqdzgls9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.01.0910271124110.31845@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> So this adds "--bisect" as a revision parsing argument, and as a result it 
> just works with all the normal logging tools. So now I can just do
>
> 	gitk --bisect --simplify-by-decoration filename-here

This shows a very nice direction to evolve, but your patch as-is breaks "rev-list --bisect", I think. Call to your setup_revisions() eats the command line "--bisect" option but cmd_rev_list() wants to see it to go into the "bisection" mode of traversal.

Also, the helper of "git bisect" can and probably should be taught to just ask this new behaviour from the revision machinery, instead of collecting good and bad refs itself using bisect.c::read_bisect_refs().

Here is a short-term fix that can be squashed in, in order to allow t6022 to pass again.

 builtin-rev-list.c |    2 ++
 revision.c         |    1 +
 revision.h         |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 4ba1c12..32bf033 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -319,6 +319,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
 
 	memset(&info, 0, sizeof(info));
 	info.revs = &revs;
+	if (revs.bisect)
+		bisect_list = 1;
 
 	quiet = DIFF_OPT_TST(&revs.diffopt, QUIET);
 	for (i = 1 ; i < argc; i++) {
diff --git a/revision.c b/revision.c
index 80a0528..a36c0d9 100644
--- a/revision.c
+++ b/revision.c
@@ -1273,6 +1273,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
 			if (!strcmp(arg, "--bisect")) {
 				handle_refs(revs, flags, for_each_bad_bisect_ref);
 				handle_refs(revs, flags ^ UNINTERESTING, for_each_good_bisect_ref);
+				revs->bisect = 1;
 				continue;
 			}
 			if (!strcmp(arg, "--tags")) {
diff --git a/revision.h b/revision.h
index b6421a6..921656a 100644
--- a/revision.h
+++ b/revision.h
@@ -63,6 +63,7 @@ struct rev_info {
 			reverse:1,
 			reverse_output_stage:1,
 			cherry_pick:1,
+			bisect:1,
 			first_parent_only:1;
 
 	/* Diff flags */
Previous: Junio C HamanoNext: Linus Torvalds
Message 3 of 5 in “Add '--bisect' revision machinery argument”
  1. Linus TorvaldsOct 27, 2009
  2. Junio C HamanoOct 28, 2009
  3. Junio C HamanoOct 28, 2009
  4. Linus TorvaldsOct 28, 2009
  5. Christian CouderOct 31, 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.