[RFC/PATCH 2/3] revision: change '--bisect' rev machinery argument to 'bisect-refs'
- From
Christian Couder <chriscool@tuxfamily.org>
- Date
- Nov 4, 2009, 04:00 UTC
- Message-ID
- <20091104040004.4545.49960.chriscool@tuxfamily.org>
- In-Reply-To
- <20091104034312.4545.2176.chriscool@tuxfamily.org>
Using '--bisect' as a revision machinery argument is bogus because it conflicts with the special '--bisect' argument for "rev-list". And as shown by a test case added by a previous commit, this cannot be fixed by adding a special flag to "struct rev_info".
So this commit just renames the '--bisect' flag to the revision machinery into '--bisect-refs', and reverts the changes that added the special flag to "struct rev_info".
This makes the test case added previously pass.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> --- builtin-rev-list.c | 2 -- builtin-rev-parse.c | 4 ++-- revision.c | 5 ++--- revision.h | 1 - t/t6030-bisect-porcelain.sh | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 9e736b4..2ccbfbb 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -320,8 +320,6 @@ 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, QUICK); for (i = 1 ; i < argc; i++) { diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c index 9526aaf..201a458 100644 --- a/builtin-rev-parse.c +++ b/builtin-rev-parse.c @@ -39,7 +39,7 @@ static int is_rev_argument(const char *arg) { static const char *rev_args[] = { "--all", - "--bisect", + "--bisect-refs", "--dense", "--branches", "--header", @@ -554,7 +554,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) for_each_ref(show_reference, NULL); continue; } - if (!strcmp(arg, "--bisect")) { + if (!strcmp(arg, "--bisect-refs")) { for_each_ref_in("refs/bisect/bad", show_reference, NULL); for_each_ref_in("refs/bisect/good", anti_reference, NULL); continue; diff --git a/revision.c b/revision.c index 5cedd15..d1a1edc 100644 --- a/revision.c +++ b/revision.c @@ -995,7 +995,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg !strcmp(arg, "--tags") || !strcmp(arg, "--remotes") || !strcmp(arg, "--reflog") || !strcmp(arg, "--not") || !strcmp(arg, "--no-walk") || !strcmp(arg, "--do-walk") || - !strcmp(arg, "--bisect")) + !strcmp(arg, "--bisect-refs")) { unkv[(*unkc)++] = arg; return 1; @@ -1270,10 +1270,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch handle_refs(revs, flags, for_each_branch_ref); continue; } - if (!strcmp(arg, "--bisect")) { + if (!strcmp(arg, "--bisect-refs")) { 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 921656a..b6421a6 100644 --- a/revision.h +++ b/revision.h @@ -63,7 +63,6 @@ struct rev_info { reverse:1, reverse_output_stage:1, cherry_pick:1, - bisect:1, first_parent_only:1; /* Diff flags */ diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 88a2877..4e4160e 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -392,7 +392,7 @@ test_expect_success 'bisect does not create a "bisect" branch' ' git branch -D bisect ' -test_expect_failure 'bisect and "rev-list --bisect"' ' +test_expect_success 'bisect and "rev-list --bisect"' ' rev_list2=$(git rev-list --bisect $HASH3 --not $HASH1) && test "$rev_list2" = "$HASH2" && rev_list4=$(git rev-list --bisect $HASH7 --not $HASH1) &&
-- 1.6.5.1.gaf97d