{"thread":{"id":"18281","subject":"[PATCH 6/7] rev-list: don't find all bisect commits if there are no skipped commits","startedAt":"2009-03-12T07:51:37Z","lastAt":"2009-03-12T07:51:37Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"107778","messageId":"20090312085137.f58fa54b.chriscool@tuxfamily.org","threadId":"18281","inReplyTo":null,"subject":"[PATCH 6/7] rev-list: don't find all bisect commits if there are no skipped commits","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-03-12T07:51:37Z","receivedAt":"2009-03-12T07:51:37Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This patch optimizes the behavior of the \"--bisect-skip\" option of\n\"git rev-list\", so that it does not try to find all possible bisection\npoints when only one is needed because there are no skipped commits.\n\nThis makes the behavior of \"git rev-list --bisect-skip\" similar as\nwhat is done in \"git-bisect.sh\" to choose if it should pass the\n\"--bisect-all\" option to \"git rev-list\". So this has the added\nbenefit that it will make the test suite pass as is when we will\nuse \"--bisect-skip\" in \"git-bisect.sh\" in a later patch.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n bisect-skip.c      |    5 +++++\n bisect.h           |    1 +\n builtin-rev-list.c |    4 +++-\n 3 files changed, 9 insertions(+), 1 deletions(-)\n\ndiff --git a/bisect-skip.c b/bisect-skip.c\nindex 9228465..789ee09 100644\n--- a/bisect-skip.c\n+++ b/bisect-skip.c\n@@ -28,6 +28,11 @@ void register_skipped(const char *skipped)\n \tstrbuf_release(&sb);\n }\n \n+int skipped_nr(void)\n+{\n+\treturn skipped_sha1_nr;\n+}\n+\n static int skipcmp(const void *a, const void *b)\n {\n \treturn hashcmp(a, b);\ndiff --git a/bisect.h b/bisect.h\nindex c5f9fe1..ff9c781 100644\n--- a/bisect.h\n+++ b/bisect.h\n@@ -2,6 +2,7 @@\n #define BISECT_H\n \n void register_skipped(const char *skipped);\n+int skipped_nr(void);\n struct commit_list *filter_skipped(struct commit_list *list,\n \t\t\t\t   struct commit_list **tried,\n \t\t\t\t   int show_all);\ndiff --git a/builtin-rev-list.c b/builtin-rev-list.c\nindex 6e0466e..4af70d7 100644\n--- a/builtin-rev-list.c\n+++ b/builtin-rev-list.c\n@@ -337,7 +337,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)\n \t\tif (!prefixcmp(arg, \"--bisect-skip=\")) {\n \t\t\tbisect_list = 1;\n \t\t\tbisect_show_vars = 1;\n-\t\t\tbisect_find_all = 1;\n \t\t\tbisect_skip = 1;\n \t\t\tregister_skipped(arg + 14);\n \t\t\tcontinue;\n@@ -384,6 +383,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)\n \tif (bisect_list) {\n \t\tint reaches = reaches, all = all;\n \n+\t\tif (bisect_skip && !bisect_find_all)\n+\t\t\tbisect_find_all = !!skipped_nr();\n+\n \t\trevs.commits = find_bisection(revs.commits, &reaches, &all,\n \t\t\t\t\t      bisect_find_all);\n \n-- \n1.6.2.83.g012a16.dirty\n"}]}