{"thread":{"id":"55543","subject":"[PATCH] t6030: add test for git bisect skip started with --term* arguments","startedAt":"2021-04-23T07:07:43Z","lastAt":"2021-04-23T07:07:43Z","messageCount":1,"participants":["Bagas Sanjaya"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"422713","messageId":"20210423070308.85275-1-bagasdotme@gmail.com","threadId":"55543","inReplyTo":null,"subject":"[PATCH] t6030: add test for git bisect skip started with --term* arguments","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-04-23T07:03:08Z","receivedAt":"2021-04-23T07:07:43Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"Trygve Aaberge reported [1] git bisect breakage when the bisection\nis started with --term* arguments (--term-new and --term-old). In that\ncase, skipping with `git bisect skip` should cause HEAD to be changed,\nbut actually the HEAD stayed same after skipping.\n\nLet's add the test to catch the breakage. Because there isn't any fixes\nyet, mark the test as test_expect_failure.\n\n[1]: https://lore.kernel.org/git/20210418151459.GC10839@aaberge.net/\n\nSigned-off-by: Bagas Sanjaya <bagasdotme@gmail.com>\n---\n\nJunio suggested that I should had written this test in t6030, not in\nseparate script as per [2], so that I could reuse the history from\nexisting tests.\n\n[2]: https://lore.kernel.org/git/xmqqa6przh08.fsf@gitster.g/\n\n t/t6030-bisect-porcelain.sh | 12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 32bb66e1ed..c500fa893d 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -299,6 +299,18 @@ test_expect_success 'bisect skip and bisect replay' '\n \tgit bisect reset\n '\n \n+# Bisect is started with --term-new and --term-old arguments,\n+# then skip. The HEAD should be changed.\n+# FIXME: Mark this test as test_expect_failure. Remove the FIXME and\n+# mark as test_expect_success when this test successes (fixed bug).\n+test_expect_failure '\"bisect skip: bisection is started with --term*\"' '\n+\tgit bisect start --term-new=fixed --term-old=unfixed $HASH5 $HASH1 &&\n+\tHASH_SKIPPED_FROM=$(git rev-parse --verify HEAD) &&\n+\tgit bisect skip &&\n+\tHASH_SKIPPED_TO=$(git rev-parse --verify HEAD) &&\n+\ttest $HASH_SKIPPED_FROM != $HASH_SKIPPED_TO\n+'\n+\n HASH6=\n test_expect_success 'bisect run & skip: cannot tell between 2' '\n \tadd_line_into_file \"6: Yet a line.\" hello &&\n\nbase-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a\n-- \n2.25.1\n\n"}]}