From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH v2 3/6] t: introduce WITH_BREAKING_CHANGES prerequisite
Date: Tue, 11 Mar 2025 14:25:02 -0700 [thread overview]
Message-ID: <20250311212505.2920181-4-gitster@pobox.com> (raw)
In-Reply-To: <20250311212505.2920181-1-gitster@pobox.com>
Earlier c5bc9a7f (Makefile: wire up build option for deprecated
features, 2025-01-22) made an unfortunate decision to introduce the
WITHOUT_BREAKING_CHANGES prerequisite to perform tests that ensure
the historical behaviour that may be different from what we will
have in the future. It would inevitably invite double-negation when
we need to add tests to ensure the behaviour we want to have in the
future.
Introduce WITH_BREAKING_CHANGES prerequisite and replace the
existing uses of WITHOUT_BREAKING_CHANGES prerequisite. To catch
any future topics that add more uses of WITHOUT_BREAKING_CHANGES,
introduce a mechanism to mark a prerequisite not to be used, and
use it to mark the removed prerequisite as such.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
t/t5323-pack-redundant.sh | 2 +-
t/t5505-remote.sh | 6 +++---
t/t5515-fetch-merge-logic.sh | 2 +-
t/t5516-fetch-push.sh | 8 ++++----
t/test-lib.sh | 7 ++++++-
5 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/t/t5323-pack-redundant.sh b/t/t5323-pack-redundant.sh
index 688cd9706c..bc30bc9652 100755
--- a/t/t5323-pack-redundant.sh
+++ b/t/t5323-pack-redundant.sh
@@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
. ./test-lib.sh
-if ! test_have_prereq WITHOUT_BREAKING_CHANGES
+if test_have_prereq WITH_BREAKING_CHANGES
then
skip_all='skipping git-pack-redundant tests; built with breaking changes'
test_done
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index bb7e0c6879..82fccf8e36 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -1123,7 +1123,7 @@ Pull: refs/heads/main:refs/heads/origin
Pull: refs/heads/next:refs/heads/origin2
EOF
-test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '
+test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '
git clone one five &&
origin_url=$(pwd)/one &&
(
@@ -1149,7 +1149,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file i
)
'
-test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '
+test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '
git clone --template= one six &&
origin_url=$(pwd)/one &&
(
@@ -1165,7 +1165,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file i
)
'
-test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '
+test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '
git clone --template= one seven &&
(
cd seven &&
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 4e6026c611..8ac04d742c 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -104,7 +104,7 @@ test_expect_success setup '
git config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&
remotes="$remotes config-glob" &&
- if test_have_prereq WITHOUT_BREAKING_CHANGES
+ if ! test_have_prereq WITH_BREAKING_CHANGES
then
mkdir -p .git/remotes &&
cat >.git/remotes/remote-explicit <<-\EOF &&
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 85ed049627..6e2b233157 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -975,7 +975,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '
! grep "warning: updating the current branch" stderr
'
-test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '
+test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches' '
mk_empty testrepo &&
git branch second $the_first_commit &&
git checkout second &&
@@ -991,7 +991,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '
git checkout main
'
-test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #' '
+test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches containing #' '
mk_empty testrepo &&
mkdir testrepo/.git/branches &&
echo "..#second" > testrepo/.git/branches/branch2 &&
@@ -1005,7 +1005,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #'
git checkout main
'
-test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '
+test_expect_success !WITH_BREAKING_CHANGES 'push with branches' '
mk_empty testrepo &&
git checkout second &&
@@ -1022,7 +1022,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '
)
'
-test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches containing #' '
+test_expect_success !WITH_BREAKING_CHANGES 'push with branches containing #' '
mk_empty testrepo &&
test_when_finished "rm -rf .git/branches" &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 9001ed3a64..fffbfb89ef 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1862,8 +1862,13 @@ test_lazy_prereq CURL '
curl --version
'
+test_lazy_prereq WITH_BREAKING_CHANGES '
+ test -n "$WITH_BREAKING_CHANGES"
+'
+
test_lazy_prereq WITHOUT_BREAKING_CHANGES '
- test -z "$WITH_BREAKING_CHANGES"
+ # Signal that this prereq should not be used.
+ exit 125
'
# SHA1 is a test if the hash algorithm in use is SHA-1. This is both for tests
--
2.49.0-rc2-181-g28e223d67e
next prev parent reply other threads:[~2025-03-11 21:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 23:16 [PATCH v1 0/4] drop "name-rev --stdin" support Junio C Hamano
2025-03-10 23:16 ` [PATCH v1 1/4] t: introduce WITH_BREAKING_CHANGES prerequisite Junio C Hamano
2025-03-10 23:53 ` Eric Sunshine
2025-03-11 12:57 ` Patrick Steinhardt
2025-03-11 17:07 ` Junio C Hamano
2025-03-10 23:16 ` [PATCH v1 2/4] t6120: avoid hiding "git" exit status Junio C Hamano
2025-03-10 23:16 ` [PATCH v1 3/4] t6120: further modernize Junio C Hamano
2025-03-10 23:16 ` [PATCH v1 4/4] name-rev: remove "--stdin" support Junio C Hamano
2025-03-11 12:57 ` Patrick Steinhardt
2025-03-11 17:07 ` Junio C Hamano
2025-03-11 21:24 ` [PATCH v2 0/6] drop "name-rev --stdin" support Junio C Hamano
2025-03-11 21:25 ` [PATCH v2 1/6] t: document test_lazy_prereq Junio C Hamano
2025-03-11 21:25 ` [PATCH v2 2/6] t: extend test_lazy_prereq Junio C Hamano
2025-03-12 7:01 ` Patrick Steinhardt
2025-03-13 11:56 ` Junio C Hamano
2025-03-11 21:25 ` Junio C Hamano [this message]
2025-03-12 7:01 ` [PATCH v2 3/6] t: introduce WITH_BREAKING_CHANGES prerequisite Patrick Steinhardt
2025-03-11 21:25 ` [PATCH v2 4/6] t6120: avoid hiding "git" exit status Junio C Hamano
2025-03-11 21:25 ` [PATCH v2 5/6] t6120: further modernize Junio C Hamano
2025-03-11 21:25 ` [PATCH v2 6/6] name-rev: remove "--stdin" support 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250311212505.2920181-4-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).