From 67e6d817945202427977cf950b5ccbad3060e9e4 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 15 Mar 2011 05:09:24 -0500 Subject: tests: stop worrying about obsolete environment variables After v0.99.7~99 (Retire support for old environment variables, 2005-09-09), there is no more need to unset a stray AUTHOR_NAME variable that might have entered the test environment. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/test-lib.sh | 7 ------- 1 file changed, 7 deletions(-) (limited to 't/test-lib.sh') diff --git a/t/test-lib.sh b/t/test-lib.sh index 0fdc541a7c..e381166f5d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -44,11 +44,6 @@ export LANG LC_ALL PAGER TERM TZ EDITOR=: unset VISUAL unset GIT_EDITOR -unset AUTHOR_DATE -unset AUTHOR_EMAIL -unset AUTHOR_NAME -unset COMMIT_AUTHOR_EMAIL -unset COMMIT_AUTHOR_NAME unset EMAIL unset GIT_ALTERNATE_OBJECT_DIRECTORIES unset GIT_AUTHOR_DATE @@ -64,8 +59,6 @@ unset GIT_EXTERNAL_DIFF unset GIT_INDEX_FILE unset GIT_OBJECT_DIRECTORY unset GIT_CEILING_DIRECTORIES -unset SHA1_FILE_DIRECTORIES -unset SHA1_FILE_DIRECTORY unset GIT_NOTES_REF unset GIT_NOTES_DISPLAY_REF unset GIT_NOTES_REWRITE_REF -- cgit v1.2.1 From 3c995beb14b7aef9fa724cde9d2b7a4ea4ae53cc Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 15 Mar 2011 04:05:10 -0500 Subject: tests: suppress system gitattributes Set GIT_ATTR_NOSYSTEM in test-lib to make tests more reliable in two ways: - an invalid GIT_ATTR_NOSYSTEM setting should not cause tests to fail with "fatal: bad config value for 'GIT_ATTR_NOSYSTEM'". - /etc/gitattributes should not change the outcome of tests. Signed-off-by: Jonathan Nieder Improved-by: Jeff King Signed-off-by: Junio C Hamano --- t/test-lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't/test-lib.sh') diff --git a/t/test-lib.sh b/t/test-lib.sh index e381166f5d..00f23fc975 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -948,7 +948,8 @@ GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt unset GIT_CONFIG GIT_CONFIG_NOSYSTEM=1 GIT_CONFIG_NOGLOBAL=1 -export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL +GIT_ATTR_NOSYSTEM=1 +export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL GIT_ATTR_NOSYSTEM . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS -- cgit v1.2.1 From 8f323c00dd3c9b396b01a1aeea74f7dfd061bb7f Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 15 Mar 2011 04:04:49 -0500 Subject: config: drop support for GIT_CONFIG_NOGLOBAL Now that test-lib sets $HOME to protect against pollution from user settings, GIT_CONFIG_NOGLOBAL is not needed for use by the test suite any more. And as luck would have it, a quick code search reveals no other users in the wild. This patch does not affect GIT_CONFIG_NOSYSTEM, which is still needed. Helped-by: Jeff King Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/test-lib.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 't/test-lib.sh') diff --git a/t/test-lib.sh b/t/test-lib.sh index 00f23fc975..8893406969 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -947,9 +947,8 @@ fi GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt unset GIT_CONFIG GIT_CONFIG_NOSYSTEM=1 -GIT_CONFIG_NOGLOBAL=1 GIT_ATTR_NOSYSTEM=1 -export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL GIT_ATTR_NOSYSTEM +export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS -- cgit v1.2.1 From 95a1d12e9b9faddc02187ca28fdeb4fddd354c59 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 15 Mar 2011 05:10:45 -0500 Subject: tests: scrub environment of GIT_* variables Variables from the inherited environment that are meaningful to git can break tests in undesirable ways. For example, GIT_PAGER=more sh t5400-send-pack.sh -v -i hangs. So unset all environment variables in the GIT_ namespace in test-lib, with a few exceptions: - GIT_TRACE* are useful for tracking down bugs exhibited by a failing test; - GIT_DEBUG* are GIT_TRACE variables by another name, practically speaking. They should probably be tweaked to follow the GIT_TRACE_foo scheme and use trace_printf machinery some time. - GIT_USE_LOOKUP from v1.5.6-rc0~134^2~1 (sha1-lookup: more memory efficient search in sorted list of SHA-1, 2007-12-29) is about trying an alternate implementation strategy rather than changing semantics and it can be useful to compare performance with and without it set. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/test-lib.sh | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 't/test-lib.sh') diff --git a/t/test-lib.sh b/t/test-lib.sh index 8893406969..8aac727fb2 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -43,29 +43,16 @@ TERM=dumb export LANG LC_ALL PAGER TERM TZ EDITOR=: unset VISUAL -unset GIT_EDITOR unset EMAIL -unset GIT_ALTERNATE_OBJECT_DIRECTORIES -unset GIT_AUTHOR_DATE +unset $(perl -e ' + my @env = keys %ENV; + my @vars = grep(/^GIT_/ && !/^GIT_(TRACE|DEBUG|USE_LOOKUP)/, @env); + print join("\n", @vars); +') GIT_AUTHOR_EMAIL=author@example.com GIT_AUTHOR_NAME='A U Thor' -unset GIT_COMMITTER_DATE GIT_COMMITTER_EMAIL=committer@example.com GIT_COMMITTER_NAME='C O Mitter' -unset GIT_DIFF_OPTS -unset GIT_DIR -unset GIT_WORK_TREE -unset GIT_EXTERNAL_DIFF -unset GIT_INDEX_FILE -unset GIT_OBJECT_DIRECTORY -unset GIT_CEILING_DIRECTORIES -unset GIT_NOTES_REF -unset GIT_NOTES_DISPLAY_REF -unset GIT_NOTES_REWRITE_REF -unset GIT_NOTES_REWRITE_MODE -unset GIT_REFLOG_ACTION -unset GIT_CHERRY_PICK_HELP -unset GIT_QUIET GIT_MERGE_VERBOSITY=5 export GIT_MERGE_VERBOSITY export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME -- cgit v1.2.1