Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Lipman <alipman88@gmail.com>2020-08-08 00:58:37 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-08 01:13:03 +0300
commite8861ffc203fe5ea3da97210e60b2e886002f218 (patch)
tree727cc7692a4e80c85631cfc3f997fa83cdf22a0a /bisect.c
parentbe5fe2000df5c1110d8086e4704e1a90a64f7387 (diff)
bisect: introduce first-parent flag
Upon seeing a merge commit when bisecting, this option may be used to follow only the first parent. In detecting regressions introduced through the merging of a branch, the merge commit will be identified as introduction of the bug and its ancestors will be ignored. This option is particularly useful in avoiding false positives when a merged branch contained broken or non-buildable commits, but the merge itself was OK. Signed-off-by: Aaron Lipman <alipman88@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bisect.c b/bisect.c
index 950ff6f533..bc4241b51f 100644
--- a/bisect.c
+++ b/bisect.c
@@ -15,6 +15,7 @@
#include "commit-slab.h"
#include "commit-reach.h"
#include "object-store.h"
+#include "dir.h"
static struct oid_array good_revs;
static struct oid_array skipped_revs;
@@ -460,6 +461,7 @@ static GIT_PATH_FUNC(git_path_bisect_run, "BISECT_RUN")
static GIT_PATH_FUNC(git_path_bisect_start, "BISECT_START")
static GIT_PATH_FUNC(git_path_bisect_log, "BISECT_LOG")
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
+static GIT_PATH_FUNC(git_path_bisect_first_parent, "BISECT_FIRST_PARENT")
static GIT_PATH_FUNC(git_path_head_name, "head-name")
static void read_bisect_paths(struct argv_array *array)
@@ -998,7 +1000,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
struct object_id *bisect_rev;
char *steps_msg;
int no_checkout = ref_exists("BISECT_HEAD");
- int first_parent_only = 0; /* TODO: pass --first-parent flag from git bisect start */
+ int first_parent_only = file_exists(git_path_bisect_first_parent());
read_bisect_terms(&term_bad, &term_good);
if (read_bisect_refs())
@@ -1142,6 +1144,7 @@ int bisect_clean_state(void)
unlink_or_warn(git_path_bisect_names());
unlink_or_warn(git_path_bisect_run());
unlink_or_warn(git_path_bisect_terms());
+ unlink_or_warn(git_path_bisect_first_parent());
/* Cleanup head-name if it got left by an old version of git-bisect */
unlink_or_warn(git_path_head_name());
/*