rev-list: add "int bisect_show_flags" in "struct rev_list_info"
This is a cleanup patch to make it easier to use the "show_bisect_vars" function and take advantage of the rev_list_info struct. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Apr 7, 2009 at 05:08 UTC
13858e5770dd218e5318819d3273c916b46cf8e5
3 files changed
+9
-12
bisect.c
+2
-2
@@ -540,6 +540,7 @@ int bisect_next_vars(const char *prefix)
540
541
memset(&info, 0, sizeof(info));
542
info.revs = &revs;
543
+ info.bisect_show_flags = BISECT_SHOW_TRIED | BISECT_SHOW_STRINGED;
544
545
bisect_rev_setup(&revs, prefix);
546
@@ -551,6 +552,5 @@ int bisect_next_vars(const char *prefix)
552
revs.commits = find_bisection(revs.commits, &reaches, &all,
553
!!skipped_sha1_nr);
554
554
- return show_bisect_vars(&info, reaches, all,
555
- BISECT_SHOW_TRIED | BISECT_SHOW_STRINGED);
555
+ return show_bisect_vars(&info, reaches, all);
556
}
bisect.h
+3
-3
@@ -9,20 +9,20 @@ extern struct commit_list *filter_skipped(struct commit_list *list,
9
struct commit_list **tried,
10
int show_all);
11
12
-/* show_bisect_vars flags */
12
+/* bisect_show_flags flags in struct rev_list_info */
13
#define BISECT_SHOW_ALL (1<<0)
14
#define BISECT_SHOW_TRIED (1<<1)
15
#define BISECT_SHOW_STRINGED (1<<2)
16
17
struct rev_list_info {
18
struct rev_info *revs;
19
+ int bisect_show_flags;
20
int show_timestamp;
21
int hdr_termination;
22
const char *header_prefix;
23
};
24
24
-extern int show_bisect_vars(struct rev_list_info *info, int reaches, int all,
25
- int flags);
25
+extern int show_bisect_vars(struct rev_list_info *info, int reaches, int all);
26
27
extern int bisect_next_vars(const char *prefix);
28
builtin-rev-list.c
+4
-7
@@ -233,10 +233,9 @@ static void show_tried_revs(struct commit_list *tried, int stringed)
233
printf(stringed ? "' &&\n" : "'\n");
234
}
235
236
-int show_bisect_vars(struct rev_list_info *info, int reaches, int all,
237
- int flags)
236
+int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
237
{
239
- int cnt;
238
+ int cnt, flags = info->bisect_show_flags;
239
char hex[41] = "", *format;
240
struct commit_list *tried;
241
struct rev_info *revs = info->revs;
@@ -303,7 +302,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
302
int bisect_list = 0;
303
int bisect_show_vars = 0;
304
int bisect_find_all = 0;
306
- int bisect_show_all = 0;
305
int quiet = 0;
306
307
git_config(git_default_config, NULL);
@@ -334,7 +332,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
332
if (!strcmp(arg, "--bisect-all")) {
333
bisect_list = 1;
334
bisect_find_all = 1;
337
- bisect_show_all = 1;
335
+ info.bisect_show_flags = BISECT_SHOW_ALL;
336
revs.show_decorations = 1;
337
continue;
338
}
@@ -387,8 +385,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
385
bisect_find_all);
386
387
if (bisect_show_vars)
390
- return show_bisect_vars(&info, reaches, all,
391
- bisect_show_all ? BISECT_SHOW_ALL : 0);
388
+ return show_bisect_vars(&info, reaches, all);
389
}
390
391
traverse_commit_list(&revs,