Skip to content

Commit

Permalink
rev-list: pass "int flags" as last argument of "show_bisect_vars"
Browse files Browse the repository at this point in the history
Instead of "int show_all, int show_tried" we now only pass "int flags",
because we will add one more flag in a later patch.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
chriscool authored and gitster committed Apr 5, 2009
1 parent b74d7ef commit 37c4c38
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,5 +547,5 @@ int bisect_next_vars(const char *prefix)
revs.commits = find_bisection(revs.commits, &reaches, &all,
!!skipped_sha1_nr);

return show_bisect_vars(&revs, reaches, all, 0, 1);
return show_bisect_vars(&revs, reaches, all, BISECT_SHOW_TRIED);
}
8 changes: 6 additions & 2 deletions bisect.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ extern struct commit_list *filter_skipped(struct commit_list *list,
struct commit_list **tried,
int show_all);

/* show_bisect_vars flags */
#define BISECT_SHOW_ALL (1<<0)
#define BISECT_SHOW_TRIED (1<<1)

/*
* The "show_all" parameter should be 0 if this function is called
* The flag BISECT_SHOW_ALL should not be set if this function is called
* from outside "builtin-rev-list.c" as otherwise it would use
* static "revs" from this file.
*/
extern int show_bisect_vars(struct rev_info *revs, int reaches, int all,
int show_all, int show_tried);
int flags);

extern int bisect_next_vars(const char *prefix);

Expand Down
13 changes: 6 additions & 7 deletions builtin-rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,16 @@ static void show_tried_revs(struct commit_list *tried)
printf("'\n");
}

int show_bisect_vars(struct rev_info *revs, int reaches, int all,
int show_all, int show_tried)
int show_bisect_vars(struct rev_info *revs, int reaches, int all, int flags)
{
int cnt;
char hex[41] = "";
struct commit_list *tried;

if (!revs->commits && !show_tried)
if (!revs->commits && !(flags & BISECT_SHOW_TRIED))
return 1;

revs->commits = filter_skipped(revs->commits, &tried, show_all);
revs->commits = filter_skipped(revs->commits, &tried, flags & BISECT_SHOW_ALL);

/*
* revs->commits can reach "reaches" commits among
Expand All @@ -264,12 +263,12 @@ int show_bisect_vars(struct rev_info *revs, int reaches, int all,
if (revs->commits)
strcpy(hex, sha1_to_hex(revs->commits->item->object.sha1));

if (show_all) {
if (flags & BISECT_SHOW_ALL) {
traverse_commit_list(revs, show_commit, show_object);
printf("------\n");
}

if (show_tried)
if (flags & BISECT_SHOW_TRIED)
show_tried_revs(tried);
printf("bisect_rev=%s\n"
"bisect_nr=%d\n"
Expand Down Expand Up @@ -379,7 +378,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)

if (bisect_show_vars)
return show_bisect_vars(&revs, reaches, all,
bisect_show_all, 0);
bisect_show_all ? BISECT_SHOW_ALL : 0);
}

traverse_commit_list(&revs,
Expand Down

0 comments on commit 37c4c38

Please sign in to comment.