{"thread":{"id":"18564","subject":"[PATCH 06/10] rev-list: pass \"revs\" to \"show_bisect_vars\"","startedAt":"2009-03-26T04:55:41Z","lastAt":"2009-03-26T04:55:41Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":10},"messages":[{"id":"109485","messageId":"20090326055541.caaabdc9.chriscool@tuxfamily.org","threadId":"18564","inReplyTo":null,"subject":"[PATCH 06/10] rev-list: pass \"revs\" to \"show_bisect_vars\"","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-03-26T04:55:41Z","receivedAt":"2009-03-26T04:55:41Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"instead of using static \"revs\" data\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n bisect.h           |    3 ++-\n builtin-rev-list.c |   13 +++++++------\n 2 files changed, 9 insertions(+), 7 deletions(-)\n\ndiff --git a/bisect.h b/bisect.h\nindex 860a15c..31c99fe 100644\n--- a/bisect.h\n+++ b/bisect.h\n@@ -5,6 +5,7 @@ extern struct commit_list *find_bisection(struct commit_list *list,\n \t\t\t\t\t  int *reaches, int *all,\n \t\t\t\t\t  int find_all);\n \n-extern int show_bisect_vars(int reaches, int all, int show_all);\n+extern int show_bisect_vars(struct rev_info *revs, int reaches, int all,\n+\t\t\t    int show_all);\n \n #endif\ndiff --git a/builtin-rev-list.c b/builtin-rev-list.c\nindex c700c34..cdb0f9d 100644\n--- a/builtin-rev-list.c\n+++ b/builtin-rev-list.c\n@@ -226,16 +226,16 @@ static int estimate_bisect_steps(int all)\n \treturn (e < 3 * x) ? n : n - 1;\n }\n \n-int show_bisect_vars(int reaches, int all, int show_all)\n+int show_bisect_vars(struct rev_info *revs, int reaches, int all, int show_all)\n {\n \tint cnt;\n \tchar hex[41];\n \n-\tif (!revs.commits)\n+\tif (!revs->commits)\n \t\treturn 1;\n \n \t/*\n-\t * revs.commits can reach \"reaches\" commits among\n+\t * revs->commits can reach \"reaches\" commits among\n \t * \"all\" commits.  If it is good, then there are\n \t * (all-reaches) commits left to be bisected.\n \t * On the other hand, if it is bad, then the set\n@@ -247,10 +247,10 @@ int show_bisect_vars(int reaches, int all, int show_all)\n \tif (cnt < reaches)\n \t\tcnt = reaches;\n \n-\tstrcpy(hex, sha1_to_hex(revs.commits->item->object.sha1));\n+\tstrcpy(hex, sha1_to_hex(revs->commits->item->object.sha1));\n \n \tif (show_all) {\n-\t\ttraverse_commit_list(&revs, show_commit, show_object);\n+\t\ttraverse_commit_list(revs, show_commit, show_object);\n \t\tprintf(\"------\\n\");\n \t}\n \n@@ -358,7 +358,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)\n \t\trevs.commits = find_bisection(revs.commits, &reaches, &all,\n \t\t\t\t\t      bisect_find_all);\n \t\tif (bisect_show_vars)\n-\t\t\treturn show_bisect_vars(reaches, all, bisect_find_all);\n+\t\t\treturn show_bisect_vars(&revs, reaches, all,\n+\t\t\t\t\t\tbisect_find_all);\n \t}\n \n \ttraverse_commit_list(&revs,\n-- \n1.6.2.1.317.g3d804\n"}]}