All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Peart <benpeart@microsoft.com>
To: "peartben@gmail.com" <peartben@gmail.com>
Cc: Ben Peart <Ben.Peart@microsoft.com>,
	"avarab@gmail.com" <avarab@gmail.com>,
	Ben Peart <Ben.Peart@microsoft.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	"gitster@pobox.com" <gitster@pobox.com>,
	"t.gummerer@gmail.com" <t.gummerer@gmail.com>
Subject: [PATCH v2 0/5] Cleanup pass on special test setups
Date: Fri, 14 Sep 2018 20:13:57 +0000	[thread overview]
Message-ID: <20180914201340.37400-1-benpeart@microsoft.com> (raw)
In-Reply-To: <80988727-085f-cdd9-e5bb-a90a55e97024@gmail.com>

Changes this round are to use Junio's more elegant script to test and warn
about using old variables and munging which changes are in which commit.

Base Ref: v2.19.0
Web-Diff: https://github.com/benpeart/git/commit/79d62d39e4
Checkout: git fetch https://github.com/benpeart/git git-test-cleanup-v2 && git checkout 79d62d39e4


### Interdiff (v1..v2):

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3f447b8ddc..17a56f44ad 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -140,38 +140,27 @@ then
 	export GIT_INDEX_VERSION
 fi
 
-if test -n "$TEST_GIT_INDEX_VERSION"
-then
-	if test -n "$GIT_TEST_INDEX_VERSION"
-	then
-		echo "warning: the TEST_GIT_INDEX_VERSION variable has been renamed to GIT_TEST_INDEX_VERSION"
-	else
-		echo "error: the TEST_GIT_INDEX_VERSION variable has been renamed to GIT_TEST_INDEX_VERSION"
-		exit 1
-	fi
-fi
-
-if test -n "$GIT_FSMONITOR_TEST"
-then
-	if test -n "$GIT_TEST_FSMONITOR"
-	then
-		echo "warning: the GIT_FSMONITOR_TEST variable has been renamed to GIT_TEST_FSMONITOR"
-	else
-		echo "error: the GIT_FSMONITOR_TEST variable has been renamed to GIT_TEST_FSMONITOR"
-		exit 1
-	fi
-fi
+check_var_migration () {
+	old_name=$1 new_name=$2
+	eval "old_isset=\${${old_name}:+isset}"
+	eval "new_isset=\${${new_name}:+isset}"
+	case "$old_isset,$new_isset" in
+	isset,)
+		echo >&2 "warning: $old_name is now $new_name"
+		echo >&2 "hint: set $new_name too during the transition period"
+		eval "$new_name=\$$old_name"
+		;;
+	isset,isset)
+		# do this later
+		# echo >&2 "warning: $old_name is now $new_name"
+		# echo >&2 "hint: remove $old_name"
+		;;
+	esac
+}
 
-if test -n "$GIT_FORCE_PRELOAD_TEST"
-then
-	if test -n "$GIT_TEST_PRELOAD_INDEX"
-	then
-		echo "warning: the GIT_FORCE_PRELOAD_TEST variable has been renamed to GIT_TEST_PRELOAD_INDEX"
-	else
-		echo "error: the GIT_FORCE_PRELOAD_TEST variable has been renamed to GIT_TEST_PRELOAD_INDEX"
-		exit 1
-	fi
-fi
+check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
+check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION
+check_var_migration GIT_FORCE_PRELOAD_TEST GIT_TEST_PRELOAD_INDEX
 
 # Add libc MALLOC and MALLOC_PERTURB test
 # only if we are not executing the test with valgrind


### Patches

Ben Peart (5):
  correct typo/spelling error in t/README
  preload-index: teach GIT_FORCE_PRELOAD_TEST to take a boolean
  fsmonitor: update GIT_TEST_FSMONITOR support
  read-cache: update TEST_GIT_INDEX_VERSION support
  preload-index: update GIT_FORCE_PRELOAD_TEST support

 Makefile                    |  6 +++---
 config.c                    |  2 +-
 preload-index.c             |  3 ++-
 t/README                    | 13 ++++++++++++-
 t/t1700-split-index.sh      |  2 +-
 t/t7519-status-fsmonitor.sh |  6 +++---
 t/test-lib.sh               | 26 ++++++++++++++++++++++++--
 7 files changed, 46 insertions(+), 12 deletions(-)


base-commit: 1d4361b0f344188ab5eec6dcea01f61a3a3a1670
-- 
2.18.0.windows.1



  parent reply	other threads:[~2018-09-14 20:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-14 14:37 [PATCH v1 0/4] Cleanup pass on special test setups Ben Peart
2018-09-14 14:37 ` [PATCH v1 1/4] correct typo/spelling error in t/README Ben Peart
2018-09-14 14:37 ` [PATCH v1 2/4] fsmonitor: update GIT_TEST_FSMONITOR support Ben Peart
2018-09-14 16:59   ` Junio C Hamano
2018-09-14 17:03     ` Junio C Hamano
2018-09-14 17:15   ` Junio C Hamano
2018-09-14 18:05     ` Ben Peart
2018-09-14 18:18       ` Junio C Hamano
2018-09-14 20:13       ` Ben Peart [this message]
2018-09-14 20:13         ` [PATCH v2 1/5] correct typo/spelling error in t/README Ben Peart
2018-09-14 20:43           ` Jonathan Nieder
2018-09-14 20:14         ` [PATCH v2 2/5] preload-index: teach GIT_FORCE_PRELOAD_TEST to take a boolean Ben Peart
2018-09-14 20:51           ` Jonathan Nieder
2018-09-14 21:54             ` Junio C Hamano
2018-09-14 20:14         ` [PATCH v2 3/5] fsmonitor: update GIT_TEST_FSMONITOR support Ben Peart
2018-09-14 20:14         ` [PATCH v2 4/5] read-cache: update TEST_GIT_INDEX_VERSION support Ben Peart
2018-09-14 22:13           ` Junio C Hamano
2018-09-14 22:26             ` Junio C Hamano
2018-09-14 20:14         ` [PATCH v2 5/5] preload-index: update GIT_FORCE_PRELOAD_TEST support Ben Peart
2018-09-14 14:37 ` [PATCH v1 3/4] read-cache: update TEST_GIT_INDEX_VERSION support Ben Peart
2018-09-14 14:37 ` [PATCH v1 4/4] preload-index: update GIT_FORCE_PRELOAD_TEST support Ben Peart
2018-09-18 23:29 ` [PATCH v3 0/5] Cleanup pass on special test setups Ben Peart
2018-09-18 23:29   ` [PATCH v3 2/5] preload-index: use git_env_bool() not getenv() for customization Ben Peart
2018-09-18 23:29   ` [PATCH v3 1/5] t/README: correct spelling of "uncommon" Ben Peart
2018-09-18 23:29   ` [PATCH v3 3/5] fsmonitor: update GIT_TEST_FSMONITOR support Ben Peart
2018-09-28 10:01     ` SZEDER Gábor
2018-09-28 14:21       ` Ben Peart
2018-09-28 14:27         ` Ben Peart
2018-09-28 18:43           ` Junio C Hamano
2018-09-18 23:29   ` [PATCH v3 4/5] read-cache: update TEST_GIT_INDEX_VERSION support Ben Peart
2018-09-18 23:29   ` [PATCH v3 5/5] preload-index: update GIT_FORCE_PRELOAD_TEST support Ben Peart
2018-09-20 18:43   ` Re*: [PATCH v3 0/5] Cleanup pass on special test setups Junio C Hamano
2018-09-25 18:44     ` Ben Peart

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=20180914201340.37400-1-benpeart@microsoft.com \
    --to=benpeart@microsoft.com \
    --cc=Ben.Peart@microsoft.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peartben@gmail.com \
    --cc=t.gummerer@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.