git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t6030: add test for git bisect skip started with --term* arguments

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Apr 23, 2021, 07:03 UTC
Message-ID
<20210423070308.85275-1-bagasdotme@gmail.com>

Trygve Aaberge reported [1] git bisect breakage when the bisection is started with --term* arguments (--term-new and --term-old). In that case, skipping with `git bisect skip` should cause HEAD to be changed, but actually the HEAD stayed same after skipping.

Let's add the test to catch the breakage. Because there isn't any fixes yet, mark the test as test_expect_failure.

[1]: https://lore.kernel.org/git/20210418151459.GC10839@aaberge.net/
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
---

Junio suggested that I should had written this test in t6030, not in separate script as per [2], so that I could reuse the history from existing tests.

[2]: https://lore.kernel.org/git/xmqqa6przh08.fsf@gitster.g/
 t/t6030-bisect-porcelain.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 32bb66e1ed..c500fa893d 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -299,6 +299,18 @@ test_expect_success 'bisect skip and bisect replay' '
 	git bisect reset
 '
 
+# Bisect is started with --term-new and --term-old arguments,
+# then skip. The HEAD should be changed.
+# FIXME: Mark this test as test_expect_failure. Remove the FIXME and
+# mark as test_expect_success when this test successes (fixed bug).
+test_expect_failure '"bisect skip: bisection is started with --term*"' '
+	git bisect start --term-new=fixed --term-old=unfixed $HASH5 $HASH1 &&
+	HASH_SKIPPED_FROM=$(git rev-parse --verify HEAD) &&
+	git bisect skip &&
+	HASH_SKIPPED_TO=$(git rev-parse --verify HEAD) &&
+	test $HASH_SKIPPED_FROM != $HASH_SKIPPED_TO
+'
+
 HASH6=
 test_expect_success 'bisect run & skip: cannot tell between 2' '
 	add_line_into_file "6: Yet a line." hello &&

base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a
-- 
2.25.1
Message 1 of 1 in “t6030: add test for git bisect skip started with --term* arguments”
  1. t6030: add test for git bisect skip started with --term* argumentsBagas Sanjaya, Apr 23, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.