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 /t/t6030-bisect-porcelain.sh
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 't/t6030-bisect-porcelain.sh')
-rwxr-xr-xt/t6030-bisect-porcelain.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index a66c4b89bc..b886529e59 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -448,6 +448,24 @@ test_expect_success 'many merge bases creation' '
grep "$SIDE_HASH5" merge_bases.txt
'
+# We want to automatically find the merge that
+# added "line" into hello.
+test_expect_success '"git bisect run --first-parent" simple case' '
+ git rev-list --first-parent $B_HASH ^$HASH4 >first_parent_chain.txt &&
+ write_script test_script.sh <<-\EOF &&
+ grep $(git rev-parse HEAD) first_parent_chain.txt || exit -1
+ ! grep line hello >/dev/null
+ EOF
+ git bisect start --first-parent &&
+ test_path_is_file ".git/BISECT_FIRST_PARENT" &&
+ git bisect good $HASH4 &&
+ git bisect bad $B_HASH &&
+ git bisect run ./test_script.sh >my_bisect_log.txt &&
+ grep "$B_HASH is the first bad commit" my_bisect_log.txt &&
+ git bisect reset &&
+ test_path_is_missing .git/BISECT_FIRST_PARENT
+'
+
test_expect_success 'good merge bases when good and bad are siblings' '
git bisect start "$B_HASH" "$A_HASH" > my_bisect_log.txt &&
test_i18ngrep "merge base must be tested" my_bisect_log.txt &&