* [PATCH 6/7] rev-list: don't find all bisect commits if there are no skipped commits
@ 2009-03-12 7:51 Christian Couder
0 siblings, 0 replies; only message in thread
From: Christian Couder @ 2009-03-12 7:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Ingo Molnar, John Tapsell, Johannes Schindelin
This patch optimizes the behavior of the "--bisect-skip" option of
"git rev-list", so that it does not try to find all possible bisection
points when only one is needed because there are no skipped commits.
This makes the behavior of "git rev-list --bisect-skip" similar as
what is done in "git-bisect.sh" to choose if it should pass the
"--bisect-all" option to "git rev-list". So this has the added
benefit that it will make the test suite pass as is when we will
use "--bisect-skip" in "git-bisect.sh" in a later patch.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
bisect-skip.c | 5 +++++
bisect.h | 1 +
builtin-rev-list.c | 4 +++-
3 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/bisect-skip.c b/bisect-skip.c
index 9228465..789ee09 100644
--- a/bisect-skip.c
+++ b/bisect-skip.c
@@ -28,6 +28,11 @@ void register_skipped(const char *skipped)
strbuf_release(&sb);
}
+int skipped_nr(void)
+{
+ return skipped_sha1_nr;
+}
+
static int skipcmp(const void *a, const void *b)
{
return hashcmp(a, b);
diff --git a/bisect.h b/bisect.h
index c5f9fe1..ff9c781 100644
--- a/bisect.h
+++ b/bisect.h
@@ -2,6 +2,7 @@
#define BISECT_H
void register_skipped(const char *skipped);
+int skipped_nr(void);
struct commit_list *filter_skipped(struct commit_list *list,
struct commit_list **tried,
int show_all);
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 6e0466e..4af70d7 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -337,7 +337,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
if (!prefixcmp(arg, "--bisect-skip=")) {
bisect_list = 1;
bisect_show_vars = 1;
- bisect_find_all = 1;
bisect_skip = 1;
register_skipped(arg + 14);
continue;
@@ -384,6 +383,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
if (bisect_list) {
int reaches = reaches, all = all;
+ if (bisect_skip && !bisect_find_all)
+ bisect_find_all = !!skipped_nr();
+
revs.commits = find_bisection(revs.commits, &reaches, &all,
bisect_find_all);
--
1.6.2.83.g012a16.dirty
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-12 7:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-12 7:51 [PATCH 6/7] rev-list: don't find all bisect commits if there are no skipped commits Christian Couder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).