t: introduce WITH_BREAKING_CHANGES prerequisite

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, mark it as a removed prerequisite. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Mar 11, 2025 at 14:25 UTC 926d18e58dc13f1c095006e7c8bdfa25ad707830
5 files changed +15 -10
t/t5323-pack-redundant.sh
+1 -1
@@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
36
37 . ./test-lib.sh
38
39 -if ! test_have_prereq WITHOUT_BREAKING_CHANGES
39 +if test_have_prereq WITH_BREAKING_CHANGES
40 then
41 skip_all='skipping git-pack-redundant tests; built with breaking changes'
42 test_done
t/t5505-remote.sh
+3 -3
@@ -1123,7 +1123,7 @@ Pull: refs/heads/main:refs/heads/origin
1123 Pull: refs/heads/next:refs/heads/origin2
1124 EOF
1125
1126 -test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '
1126 +test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '
1127 git clone one five &&
1128 origin_url=$(pwd)/one &&
1129 (
@@ -1149,7 +1149,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file i
1149 )
1150 '
1151
1152 -test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '
1152 +test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '
1153 git clone --template= one six &&
1154 origin_url=$(pwd)/one &&
1155 (
@@ -1165,7 +1165,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file i
1165 )
1166 '
1167
1168 -test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '
1168 +test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '
1169 git clone --template= one seven &&
1170 (
1171 cd seven &&
t/t5515-fetch-merge-logic.sh
+1 -1
@@ -104,7 +104,7 @@ test_expect_success setup '
104 git config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&
105 remotes="$remotes config-glob" &&
106
107 - if test_have_prereq WITHOUT_BREAKING_CHANGES
107 + if ! test_have_prereq WITH_BREAKING_CHANGES
108 then
109 mkdir -p .git/remotes &&
110 cat >.git/remotes/remote-explicit <<-\EOF &&
t/t5516-fetch-push.sh
+4 -4
@@ -975,7 +975,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '
975 ! grep "warning: updating the current branch" stderr
976 '
977
978 -test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '
978 +test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches' '
979 mk_empty testrepo &&
980 git branch second $the_first_commit &&
981 git checkout second &&
@@ -991,7 +991,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '
991 git checkout main
992 '
993
994 -test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #' '
994 +test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches containing #' '
995 mk_empty testrepo &&
996 mkdir testrepo/.git/branches &&
997 echo "..#second" > testrepo/.git/branches/branch2 &&
@@ -1005,7 +1005,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #'
1005 git checkout main
1006 '
1007
1008 -test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '
1008 +test_expect_success !WITH_BREAKING_CHANGES 'push with branches' '
1009 mk_empty testrepo &&
1010 git checkout second &&
1011
@@ -1022,7 +1022,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '
1022 )
1023 '
1024
1025 -test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches containing #' '
1025 +test_expect_success !WITH_BREAKING_CHANGES 'push with branches containing #' '
1026 mk_empty testrepo &&
1027
1028 test_when_finished "rm -rf .git/branches" &&
t/test-lib.sh
+6 -1
@@ -1862,8 +1862,13 @@ test_lazy_prereq CURL '
1862 curl --version
1863 '
1864
1865 +test_lazy_prereq WITH_BREAKING_CHANGES '
1866 + test -n "$WITH_BREAKING_CHANGES"
1867 +'
1868 +
1869 test_lazy_prereq WITHOUT_BREAKING_CHANGES '
1866 - test -z "$WITH_BREAKING_CHANGES"
1870 + # Signal that this prereq should not be used.
1871 + exit 125
1872 '
1873
1874 # SHA1 is a test if the hash algorithm in use is SHA-1. This is both for tests