list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Bagas Sanjaya <>
Cc: Christian Couder <>,
	Christian Couder <>,
	Pranit Bauva <>,
	Eric Sunshine <>,
	Junio C Hamano <>,
	Ramsay Jones <>,
	Bagas Sanjaya <>,
	Trygve Aaberge <>
Subject: [PATCH v4] t6030: add test for git bisect skip started with --term* arguments
Date: Thu, 29 Apr 2021 14:24:51 +0700	[thread overview]
Message-ID: <> (raw)

Trygve Aaberge reported git bisect breakage when the bisection
is started with --term* arguments (--term-new and --term-old).

For example, suppose that we have repository with 10 commits, and we
start the bisection from HEAD to first commit (HEAD~9) with:

  $ git bisect start --term-new=fixed --term-old=unfixed HEAD HEAD~9

The bisection then stopped at HEAD~5 (fifth commit), and we choose
to skip (git bisect skip). The HEAD should now at HEAD~4 (sixth commit).
In the breakage, however, the HEAD after skipping stayed at HEAD~5
(not changed). The breakage is caused by forgetting to read '.git/BISECT_TERMS' during implementation of `'bisect skip' subcommand in C.

The fix is in commit 002241336f (bisect--helper: use BISECT_TERMS in
'bisect skip' command, 2021-04-25). To verify it fixes the breakage, add
the test.

Reported-by: Trygve Aaberge <>
Signed-off-by: Bagas Sanjaya <>
  Changes from v3 [1]:
    * Lowercase local name variable hash_skipped_from and hash_skipped_to.
      Christian Couder and Eric Sunshine argued that uppercase local
      variable names make the reader confused them with global
    * Mention breakage fix commit 002241336f in the commit message.


 t/ | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/t/ b/t/
index 32bb66e1ed..a1baf4e451 100755
--- a/t/
+++ b/t/
@@ -922,6 +922,17 @@ test_expect_success 'bisect start takes options and revs in any order' '
 	test_cmp expected actual
+# Bisect is started with --term-new and --term-old arguments,
+# then skip. The HEAD should be changed.
+test_expect_success 'bisect skip works with --term*' '
+	git bisect reset &&
+	git bisect start --term-new=fixed --term-old=unfixed HEAD $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"
 test_expect_success 'git bisect reset cleans bisection state properly' '
 	git bisect reset &&
 	git bisect start &&

base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a

             reply	other threads:[~2021-04-29  7:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29  7:24 Bagas Sanjaya [this message]
2021-04-29  8:05 ` Christian Couder
2021-04-29  8:20   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v4] t6030: add test for git bisect skip started with --term* arguments' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

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 read-only IMAP folder(s) and NNTP newsgroup(s).