{"thread":{"id":"26736","subject":"[PATCH 0/3] tests: unsetting variables that influence the outcome","startedAt":"2011-03-15T06:49:33Z","lastAt":"2011-03-15T20:01:03Z","messageCount":15,"participants":["Jonathan Nieder","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"163364","messageId":"20110315064909.GA25738@elie","threadId":"26736","inReplyTo":null,"subject":"[PATCH 0/3] tests: unsetting variables that influence the outcome","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T06:49:33Z","receivedAt":"2011-03-15T06:49:33Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nThese patches were rotting in my tree so I thought I should\ntry sending them out.  Maybe they can be useful.\n\nThe theme: settings from the inherited environment like GIT_PAGER can\nbreak tests in undesirable ways.  For example,\n\n GIT_PAGER=more sh t5400-send-pack.sh -v -i\n\nhangs.\n\nJonathan Nieder (3):\n  tests: protect against GIT_ATTR_NOGLOBAL from environment\n  tests: suppress global and system gitattributes\n  tests: scrub environment of GIT_* variables\n\n t/t0003-attributes.sh |    1 +\n t/test-lib.sh         |   36 +++++++++++++++++++++++++++++++++++-\n 2 files changed, 36 insertions(+), 1 deletions(-)\n"},{"id":"163365","messageId":"20110315065617.GA29530@elie","threadId":"26736","inReplyTo":"20110315064909.GA25738@elie","subject":"[PATCH 1/3] tests: protect against GIT_ATTR_NOGLOBAL from environment","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T06:56:17Z","receivedAt":"2011-03-15T06:56:17Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"The GIT_ATTR_NOGLOBAL environment variable simulates a totally clean\nenvironment with no ~/.gitattributes present.  The intent is to\nmake test results more easily reproducible, but it currently has\nthe opposite effect --- if GIT_ATTR_NOGLOBAL is set to 1, t0003.3\n(core.attributesfile) fails.\n\nUnset GIT_ATTR_NOGLOBAL in the affected test script.  test-lib already\nsets $HOME to protect against pollution from user settings, so this\nshould be safe.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/t0003-attributes.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh\nindex ebbc755..3cfc824 100755\n--- a/t/t0003-attributes.sh\n+++ b/t/t0003-attributes.sh\n@@ -18,6 +18,7 @@ attr_check () {\n \n test_expect_success 'setup' '\n \n+\tsane_unset GIT_ATTR_NOGLOBAL &&\n \tmkdir -p a/b/d a/c &&\n \t(\n \t\techo \"[attr]notest !test\"\n-- \n1.7.4.1\n"},{"id":"163366","messageId":"20110315065643.GB29530@elie","threadId":"26736","inReplyTo":"20110315064909.GA25738@elie","subject":"[PATCH 2/3] tests: suppress global and system gitattributes","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T06:56:43Z","receivedAt":"2011-03-15T06:56:43Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Set GIT_ATTR_NOGLOBAL and GIT_ATTR_NOSYSTEM in test-lib to make\ntests more reliable in two ways:\n\n - an invalid GIT_ATTR_NOGLOBAL or GIT_ATTR_NOSYSTEM setting\n   should not cause tests to fail with\n\n\tfatal: bad config value for 'GIT_ATTR_NOGLOBAL'\n\n - /etc/gitattributes should not change the outcome of tests.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/test-lib.sh |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fdc541..8ae03c7 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -955,7 +955,10 @@ GIT_TEMPLATE_DIR=\"$GIT_BUILD_DIR\"/templates/blt\n unset GIT_CONFIG\n GIT_CONFIG_NOSYSTEM=1\n GIT_CONFIG_NOGLOBAL=1\n-export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL\n+GIT_ATTR_NOSYSTEM=1\n+GIT_ATTR_NOGLOBAL=1\n+export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR\n+export GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL GIT_ATTR_NOSYSTEM GIT_ATTR_NOGLOBAL\n \n . \"$GIT_BUILD_DIR\"/GIT-BUILD-OPTIONS\n \n-- \n1.7.4.1\n"},{"id":"163367","messageId":"20110315070445.GC29530@elie","threadId":"26736","inReplyTo":"20110315064909.GA25738@elie","subject":"[PATCH 3/3] tests: scrub environment of GIT_* variables","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T07:04:45Z","receivedAt":"2011-03-15T07:04:45Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Variables from the inherited environment that are meaningful to git\ncan break tests in undesirable ways.  For example,\n\n GIT_PAGER=more sh t5400-send-pack.sh -v -i\n\nhangs.  So unset them in test-lib.\n\nThe variables to unset were found with 'git grep -F -e '\"GIT_'.\n\nException: leave the GIT_USE_LOOKUP variable from v1.5.6-rc0~134^2~1\n(sha1-lookup: more memory efficient search in sorted list of SHA-1,\n2007-12-29) alone, since it is about trying an alternate\nimplementation strategy rather than changing semantics and it can be\nuseful to compare performance with and without it set.\n\nLonger term, it would be nice to just unset all GIT_* variables (with\nexceptions like GIT_TRACE and GIT_USE_LOOKUP) with some magic using\nthe \"env\" command.  That is less straightforward than one might hope\nbecause the values of environment variables can contain embedded\nnewlines and equal signs and \"env -0\" is not portable.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nIIRC the patch is based on v1.7.4.1.  So it does not handle\nGIT_ASK_YESNO or GIT_TRACE_PACKET; they're too new.\n\nThanks for reading.  Hopefully it was not too dull.\n\n t/test-lib.sh |   31 +++++++++++++++++++++++++++++++\n 1 files changed, 31 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 8ae03c7..26c6707 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -43,7 +43,11 @@ TERM=dumb\n export LANG LC_ALL PAGER TERM TZ\n EDITOR=:\n unset VISUAL\n+unset GIT_ASKPASS\n unset GIT_EDITOR\n+unset GIT_PAGER\n+unset GIT_MAN_VIEWER\n+unset GIT_SSH\n unset AUTHOR_DATE\n unset AUTHOR_EMAIL\n unset AUTHOR_NAME\n@@ -62,16 +66,43 @@ unset GIT_DIR\n unset GIT_WORK_TREE\n unset GIT_EXTERNAL_DIFF\n unset GIT_INDEX_FILE\n+unset GIT_GRAFT_FILE\n unset GIT_OBJECT_DIRECTORY\n unset GIT_CEILING_DIRECTORIES\n+unset GIT_DISCOVERY_ACROSS_FILESYSTEM\n unset SHA1_FILE_DIRECTORIES\n unset SHA1_FILE_DIRECTORY\n+unset GIT_NO_REPLACE_OBJECTS\n+unset GIT_CONFIG_PARAMETERS\n unset GIT_NOTES_REF\n unset GIT_NOTES_DISPLAY_REF\n unset GIT_NOTES_REWRITE_REF\n unset GIT_NOTES_REWRITE_MODE\n unset GIT_REFLOG_ACTION\n unset GIT_CHERRY_PICK_HELP\n+unset GIT_CURL_FTP_NO_EPSV\n+unset GIT_CURL_VERBOSE\n+unset GIT_PROJECT_ROOT\n+unset GIT_PROXY_COMMAND\n+unset GIT_HTTP_EXPORT_ALL\n+unset GIT_HTTP_LOW_SPEED_LIMIT\n+unset GIT_HTTP_LOW_SPEED_TIME\n+unset GIT_HTTP_MAX_REQUESTS\n+unset GIT_HTTP_USER_AGENT\n+unset GIT_SSL_CAINFO\n+unset GIT_SSL_CAPATH\n+unset GIT_SSL_CERT\n+unset GIT_SSL_CERT_PASSWORD_PROTECTED\n+unset GIT_SSL_KEY\n+unset GIT_SSL_NO_VERIFY\n+unset GIT_FLUSH\n+unset GIT_PAGER_IN_USE\n+unset GIT_SEND_EMAIL_NOTTY\n+unset GIT_DEBUG_LOOKUP\n+unset GIT_DEBUG_SEND_PACK\n+unset GIT_DEBUG_TESTGIT\n+unset GIT_TRANSLOOP_DEBUG\n+unset GIT_TRANSPORT_HELPER_DEBUG\n unset GIT_QUIET\n GIT_MERGE_VERBOSITY=5\n export GIT_MERGE_VERBOSITY\n-- \n1.7.4.1\n"},{"id":"163368","messageId":"20110315071625.GA11754@sigill.intra.peff.net","threadId":"26736","inReplyTo":"20110315065643.GB29530@elie","subject":"Re: [PATCH 2/3] tests: suppress global and system gitattributes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-03-15T07:16:25Z","receivedAt":"2011-03-15T07:16:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 15, 2011 at 01:56:43AM -0500, Jonathan Nieder wrote:\n\n> Set GIT_ATTR_NOGLOBAL and GIT_ATTR_NOSYSTEM in test-lib to make\n> tests more reliable in two ways:\n> \n>  - an invalid GIT_ATTR_NOGLOBAL or GIT_ATTR_NOSYSTEM setting\n>    should not cause tests to fail with\n> \n> \tfatal: bad config value for 'GIT_ATTR_NOGLOBAL'\n> \n>  - /etc/gitattributes should not change the outcome of tests.\n\nWe already munge $HOME, as you note in 1/3, I don't know that there is\nmuch point in setting GIT_ATTR_NOGLOBAL. The alternative would be to\ndrop your 1/3 and unset GIT_ATTR_NOGLOBAL in test-lib.sh.\n\nI don't care much either way. Having it set prevents others tests from\naccidentally triggering global attributes (since we have the odd case of\n$HOME and the repo in the same directory). But IIRC, they'd have to set\ncore.attributesfile anyway, so that is not likely to happen.\n\nAnd what you're doing at least matches what GIT_CONFIG_* does (I think\nGIT_CONFIG_NOGLOBAL is also redundant in the tests at this point).\n\nSo I'm fine with either strategy. But definitely it should be protected,\nso thanks for looking into it.\n\n-Peff\n"},{"id":"163369","messageId":"20110315073718.GB11754@sigill.intra.peff.net","threadId":"26736","inReplyTo":"20110315070445.GC29530@elie","subject":"Re: [PATCH 3/3] tests: scrub environment of GIT_* variables","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-03-15T07:37:18Z","receivedAt":"2011-03-15T07:37:18Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 15, 2011 at 02:04:45AM -0500, Jonathan Nieder wrote:\n\n> Variables from the inherited environment that are meaningful to git\n> can break tests in undesirable ways.  For example,\n> \n>  GIT_PAGER=more sh t5400-send-pack.sh -v -i\n> \n> hangs.  So unset them in test-lib.\n> \n> The variables to unset were found with 'git grep -F -e '\"GIT_'.\n\nThanks. I fixed a few of these in a1231de recently, but was too lazy to\ndo an exhaustive search. Your list and your method look sane to me.\n\n> Exception: leave the GIT_USE_LOOKUP variable from v1.5.6-rc0~134^2~1\n> (sha1-lookup: more memory efficient search in sorted list of SHA-1,\n> 2007-12-29) alone, since it is about trying an alternate\n> implementation strategy rather than changing semantics and it can be\n> useful to compare performance with and without it set.\n\nMakes sense to me.\n\n> Longer term, it would be nice to just unset all GIT_* variables (with\n> exceptions like GIT_TRACE and GIT_USE_LOOKUP) with some magic using\n> the \"env\" command.  That is less straightforward than one might hope\n> because the values of environment variables can contain embedded\n> newlines and equal signs and \"env -0\" is not portable.\n\nAccording to posix, just running \"set\" provides an unambiguous,\nparseable output. The problem is that it's actual shell, so it's a\nlittle tricky to parse (it's single-quoted, and you have to follow\nvalues across embedded newlines). So it's probably not worth the\nheadache.\n\nHaving a big list of \"clear these variables\" is probably not the end of\nthe world.  If it breaks somebody's test run, they'll probably report it\nand we'll fix it. We don't add variables like this all that often.\n\n-Peff\n"},{"id":"163370","messageId":"20110315090225.GA1576@elie","threadId":"26736","inReplyTo":"20110315071625.GA11754@sigill.intra.peff.net","subject":"[PATCH 1-2/3 v2 0/3] Re: tests: suppress global and system gitattributes","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T09:02:25Z","receivedAt":"2011-03-15T09:02:25Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jeff King wrote:\n\n> The alternative would be to\n> drop your 1/3 and unset GIT_ATTR_NOGLOBAL in test-lib.sh.\n\nHmm, how about this?  These are meant as a replacement for 1/3\nand 2/3.\n\nJonathan Nieder (3):\n  gitattributes: drop support for GIT_ATTR_NOGLOBAL\n  config: drop support for GIT_CONFIG_NOGLOBAL\n  tests: suppress system gitattributes\n\n attr.c                          |    7 +------\n builtin/config.c                |    2 +-\n cache.h                         |    1 -\n config.c                        |    7 +------\n t/t0001-init.sh                 |    5 +----\n t/t5601-clone.sh                |    1 -\n t/t9130-git-svn-authors-file.sh |    1 -\n t/test-lib.sh                   |    4 ++--\n 8 files changed, 6 insertions(+), 22 deletions(-)\n"},{"id":"163371","messageId":"20110315090415.GB1576@elie","threadId":"26736","inReplyTo":"20110315090225.GA1576@elie","subject":"[PATCH 1/3] gitattributes: drop support for GIT_ATTR_NOGLOBAL","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T09:04:15Z","receivedAt":"2011-03-15T09:04:15Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"test-lib sets $HOME to protect against pollution from user settings,\nso setting GIT_ATTR_NOGLOBAL would be redundant.  Simplify by\neliminating support for that environment variable altogether.\n\nGIT_ATTR_NOGLOBAL was introduced in v1.7.4-rc0~208^2 (Add global and\nsystem-wide gitattributes, 2010-09-01) as an undocumented feature for\nuse by the test suite.  It never ended up being used (neither within\ngit.git nor in other projects).\n\nThis patch does not affect GIT_ATTR_NOSYSTEM, which should still be\nuseful.\n\nHelped-by: Jeff King <peff@peff.net>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n attr.c |    7 +------\n 1 files changed, 1 insertions(+), 6 deletions(-)\n\ndiff --git a/attr.c b/attr.c\nindex 6aff695..0e28ba8 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -478,11 +478,6 @@ int git_attr_system(void)\n \treturn !git_env_bool(\"GIT_ATTR_NOSYSTEM\", 0);\n }\n \n-int git_attr_global(void)\n-{\n-\treturn !git_env_bool(\"GIT_ATTR_NOGLOBAL\", 0);\n-}\n-\n static int git_attr_config(const char *var, const char *value, void *dummy)\n {\n \tif (!strcmp(var, \"core.attributesfile\"))\n@@ -511,7 +506,7 @@ static void bootstrap_attr_stack(void)\n \t\t}\n \n \t\tgit_config(git_attr_config, NULL);\n-\t\tif (git_attr_global() && attributes_file) {\n+\t\tif (attributes_file) {\n \t\t\telem = read_attr_from_file(attributes_file, 1);\n \t\t\tif (elem) {\n \t\t\t\telem->origin = NULL;\n-- \n1.7.4.1\n"},{"id":"163372","messageId":"20110315090449.GC1576@elie","threadId":"26736","inReplyTo":"20110315090225.GA1576@elie","subject":"[PATCH 2/3] config: drop support for GIT_CONFIG_NOGLOBAL","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T09:04:49Z","receivedAt":"2011-03-15T09:04:49Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Now that test-lib sets $HOME to protect against pollution from user\nsettings, GIT_CONFIG_NOGLOBAL is not needed for use by the test\nsuite any more.  And as luck would have it, a quick code search\nreveals no other users in the wild.\n\nThis patch does not affect GIT_CONFIG_NOSYSTEM, which is still\nneeded.\n\nHelped-by: Jeff King <peff@peff.net>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/config.c                |    2 +-\n cache.h                         |    1 -\n config.c                        |    7 +------\n t/t0001-init.sh                 |    5 +----\n t/t5601-clone.sh                |    1 -\n t/t9130-git-svn-authors-file.sh |    1 -\n t/test-lib.sh                   |    3 +--\n 7 files changed, 4 insertions(+), 16 deletions(-)\n\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 76be0b7..3e3c528 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -160,7 +160,7 @@ static int get_value(const char *key_, const char *regex_)\n \tif (!local) {\n \t\tconst char *home = getenv(\"HOME\");\n \t\tlocal = repo_config = git_pathdup(\"config\");\n-\t\tif (git_config_global() && home)\n+\t\tif (home)\n \t\t\tglobal = xstrdup(mkpath(\"%s/.gitconfig\", home));\n \t\tif (git_config_system())\n \t\t\tsystem_wide = git_etc_gitconfig();\ndiff --git a/cache.h b/cache.h\nindex d0bbc91..a8ef37a 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1020,7 +1020,6 @@ extern const char *git_etc_gitconfig(void);\n extern int check_repository_format_version(const char *var, const char *value, void *cb);\n extern int git_env_bool(const char *, int);\n extern int git_config_system(void);\n-extern int git_config_global(void);\n extern int config_error_nonbool(const char *);\n extern const char *get_log_output_encoding(void);\n extern const char *get_commit_output_encoding(void);\ndiff --git a/config.c b/config.c\nindex b94de8f..217a77d 100644\n--- a/config.c\n+++ b/config.c\n@@ -826,11 +826,6 @@ int git_config_system(void)\n \treturn !git_env_bool(\"GIT_CONFIG_NOSYSTEM\", 0);\n }\n \n-int git_config_global(void)\n-{\n-\treturn !git_env_bool(\"GIT_CONFIG_NOGLOBAL\", 0);\n-}\n-\n int git_config_from_parameters(config_fn_t fn, void *data)\n {\n \tstatic int loaded_environment;\n@@ -862,7 +857,7 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config)\n \t}\n \n \thome = getenv(\"HOME\");\n-\tif (git_config_global() && home) {\n+\tif (home) {\n \t\tchar *user_config = xstrdup(mkpath(\"%s/.gitconfig\", home));\n \t\tif (!access(user_config, R_OK)) {\n \t\t\tret += git_config_from_file(fn, user_config, data);\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex f684993..ce4ba13 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -47,7 +47,7 @@ test_expect_success 'plain nested in bare' '\n \n test_expect_success 'plain through aliased command, outside any git repo' '\n \t(\n-\t\tsane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG_NOGLOBAL &&\n+\t\tsane_unset GIT_DIR GIT_WORK_TREE &&\n \t\tHOME=$(pwd)/alias-config &&\n \t\texport HOME &&\n \t\tmkdir alias-config &&\n@@ -231,7 +231,6 @@ test_expect_success 'init with init.templatedir set' '\n \t\tgit config -f \"$test_config\"  init.templatedir \"${HOME}/templatedir-source\" &&\n \t\tmkdir templatedir-set &&\n \t\tcd templatedir-set &&\n-\t\tsane_unset GIT_CONFIG_NOGLOBAL &&\n \t\tsane_unset GIT_TEMPLATE_DIR &&\n \t\tNO_SET_GIT_TEMPLATE_DIR=t &&\n \t\texport NO_SET_GIT_TEMPLATE_DIR &&\n@@ -243,7 +242,6 @@ test_expect_success 'init with init.templatedir set' '\n test_expect_success 'init --bare/--shared overrides system/global config' '\n \t(\n \t\ttest_config=\"$HOME\"/.gitconfig &&\n-\t\tsane_unset GIT_CONFIG_NOGLOBAL &&\n \t\tgit config -f \"$test_config\" core.bare false &&\n \t\tgit config -f \"$test_config\" core.sharedRepository 0640 &&\n \t\tmkdir init-bare-shared-override &&\n@@ -258,7 +256,6 @@ test_expect_success 'init --bare/--shared overrides system/global config' '\n test_expect_success 'init honors global core.sharedRepository' '\n \t(\n \t\ttest_config=\"$HOME\"/.gitconfig &&\n-\t\tsane_unset GIT_CONFIG_NOGLOBAL &&\n \t\tgit config -f \"$test_config\" core.sharedRepository 0666 &&\n \t\tmkdir shared-honor-global &&\n \t\tcd shared-honor-global &&\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 987e0c8..3ca275c 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -164,7 +164,6 @@ test_expect_success 'clone a void' '\n test_expect_success 'clone respects global branch.autosetuprebase' '\n \t(\n \t\ttest_config=\"$HOME/.gitconfig\" &&\n-\t\tunset GIT_CONFIG_NOGLOBAL &&\n \t\tgit config -f \"$test_config\" branch.autosetuprebase remote &&\n \t\trm -fr dst &&\n \t\tgit clone src dst &&\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex ec0a106..b324c49 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -96,7 +96,6 @@ test_expect_success 'fresh clone with svn.authors-file in config' '\n \t\trm -r \"$GIT_DIR\" &&\n \t\ttest x = x\"$(git config svn.authorsfile)\" &&\n \t\ttest_config=\"$HOME\"/.gitconfig &&\n-\t\tunset GIT_CONFIG_NOGLOBAL &&\n \t\tunset GIT_DIR &&\n \t\tunset GIT_CONFIG &&\n \t\tgit config --global \\\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0fdc541..94595e3 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -954,8 +954,7 @@ fi\n GIT_TEMPLATE_DIR=\"$GIT_BUILD_DIR\"/templates/blt\n unset GIT_CONFIG\n GIT_CONFIG_NOSYSTEM=1\n-GIT_CONFIG_NOGLOBAL=1\n-export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL\n+export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM\n \n . \"$GIT_BUILD_DIR\"/GIT-BUILD-OPTIONS\n \n-- \n1.7.4.1\n"},{"id":"163373","messageId":"20110315090510.GD1576@elie","threadId":"26736","inReplyTo":"20110315090225.GA1576@elie","subject":"[PATCH 3/3] tests: suppress system gitattributes","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T09:05:10Z","receivedAt":"2011-03-15T09:05:10Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Set GIT_ATTR_NOSYSTEM in test-lib to make tests more reliable in two\nways:\n\n - an invalid GIT_ATTR_NOSYSTEM setting should not cause tests to fail\n   with \"fatal: bad config value for 'GIT_ATTR_NOSYSTEM'\".\n\n - /etc/gitattributes should not change the outcome of tests.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\nImproved-by: Jeff King <peff@peff.net>\n---\n t/test-lib.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 94595e3..f35ba6f 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -954,7 +954,8 @@ fi\n GIT_TEMPLATE_DIR=\"$GIT_BUILD_DIR\"/templates/blt\n unset GIT_CONFIG\n GIT_CONFIG_NOSYSTEM=1\n-export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM\n+GIT_ATTR_NOSYSTEM=1\n+export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM\n \n . \"$GIT_BUILD_DIR\"/GIT-BUILD-OPTIONS\n \n-- \n1.7.4.1\n"},{"id":"163376","messageId":"20110315100846.GB3923@elie","threadId":"26736","inReplyTo":"20110315073718.GB11754@sigill.intra.peff.net","subject":"[RFC/PATCH 0/2] tests: stop hard-coding the list of GIT_* vars to scrub","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T10:08:46Z","receivedAt":"2011-03-15T10:08:46Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jeff King wrote:\n\n> According to posix, just running \"set\" provides an unambiguous,\n> parseable output. The problem is that it's actual shell, so it's a\n> little tricky to parse (it's single-quoted, and you have to follow\n> values across embedded newlines). So it's probably not worth the\n> headache.\n>\n> Having a big list of \"clear these variables\" is probably not the end of\n> the world.\n\nHere's one way (using perl), for what it's worth.\n\nJonathan Nieder (2):\n  tests: stop worrying about obsolete environment variables\n  tests: scrub environment of GIT_* variables\n\n t/test-lib.sh |   30 +++++-------------------------\n 1 files changed, 5 insertions(+), 25 deletions(-)\n"},{"id":"163377","messageId":"20110315100924.GC3923@elie","threadId":"26736","inReplyTo":"20110315100846.GB3923@elie","subject":"[PATCH 1/2] tests: stop worrying about obsolete environment variables","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T10:09:24Z","receivedAt":"2011-03-15T10:09:24Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"After v0.99.7~99 (Retire support for old environment variables,\n2005-09-09), there is no more need to unset a stray AUTHOR_NAME\nvariable that might have entered the test environment.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/test-lib.sh |    7 -------\n 1 files changed, 0 insertions(+), 7 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex f35ba6f..8893406 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -44,11 +44,6 @@ export LANG LC_ALL PAGER TERM TZ\n EDITOR=:\n unset VISUAL\n unset GIT_EDITOR\n-unset AUTHOR_DATE\n-unset AUTHOR_EMAIL\n-unset AUTHOR_NAME\n-unset COMMIT_AUTHOR_EMAIL\n-unset COMMIT_AUTHOR_NAME\n unset EMAIL\n unset GIT_ALTERNATE_OBJECT_DIRECTORIES\n unset GIT_AUTHOR_DATE\n@@ -64,8 +59,6 @@ unset GIT_EXTERNAL_DIFF\n unset GIT_INDEX_FILE\n unset GIT_OBJECT_DIRECTORY\n unset GIT_CEILING_DIRECTORIES\n-unset SHA1_FILE_DIRECTORIES\n-unset SHA1_FILE_DIRECTORY\n unset GIT_NOTES_REF\n unset GIT_NOTES_DISPLAY_REF\n unset GIT_NOTES_REWRITE_REF\n-- \n1.7.4.1\n"},{"id":"163378","messageId":"20110315101045.GD3923@elie","threadId":"26736","inReplyTo":"20110315100846.GB3923@elie","subject":"[RFC/PATCH 2/2] tests: scrub environment of GIT_* variables","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-03-15T10:10:45Z","receivedAt":"2011-03-15T10:10:45Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Variables from the inherited environment that are meaningful to git\ncan break tests in undesirable ways.  For example,\n\n\tGIT_PAGER=more sh t5400-send-pack.sh -v -i\n\nhangs.  So unset all environment variables in the GIT_ namespace in\ntest-lib, with a few exceptions:\n\n- GIT_TRACE* are useful for tracking down bugs exhibited by a failing\n  test;\n\n- GIT_DEBUG* are GIT_TRACE variables by another name, practically\n  speaking.  They should probably be tweaked to follow the\n  GIT_TRACE_foo scheme and use trace_printf machinery some time.\n\n- GIT_USE_LOOKUP from v1.5.6-rc0~134^2~1 (sha1-lookup: more memory\n  efficient search in sorted list of SHA-1, 2007-12-29) is about\n  trying an alternate implementation strategy rather than changing\n  semantics and it can be useful to compare performance with and\n  without it set.\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nThanks again.\n\n t/test-lib.sh |   23 +++++------------------\n 1 files changed, 5 insertions(+), 18 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 8893406..8aac727 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -43,29 +43,16 @@ TERM=dumb\n export LANG LC_ALL PAGER TERM TZ\n EDITOR=:\n unset VISUAL\n-unset GIT_EDITOR\n unset EMAIL\n-unset GIT_ALTERNATE_OBJECT_DIRECTORIES\n-unset GIT_AUTHOR_DATE\n+unset $(perl -e '\n+\tmy @env = keys %ENV;\n+\tmy @vars = grep(/^GIT_/ && !/^GIT_(TRACE|DEBUG|USE_LOOKUP)/, @env);\n+\tprint join(\"\\n\", @vars);\n+')\n GIT_AUTHOR_EMAIL=author@example.com\n GIT_AUTHOR_NAME='A U Thor'\n-unset GIT_COMMITTER_DATE\n GIT_COMMITTER_EMAIL=committer@example.com\n GIT_COMMITTER_NAME='C O Mitter'\n-unset GIT_DIFF_OPTS\n-unset GIT_DIR\n-unset GIT_WORK_TREE\n-unset GIT_EXTERNAL_DIFF\n-unset GIT_INDEX_FILE\n-unset GIT_OBJECT_DIRECTORY\n-unset GIT_CEILING_DIRECTORIES\n-unset GIT_NOTES_REF\n-unset GIT_NOTES_DISPLAY_REF\n-unset GIT_NOTES_REWRITE_REF\n-unset GIT_NOTES_REWRITE_MODE\n-unset GIT_REFLOG_ACTION\n-unset GIT_CHERRY_PICK_HELP\n-unset GIT_QUIET\n GIT_MERGE_VERBOSITY=5\n export GIT_MERGE_VERBOSITY\n export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n-- \n1.7.4.1\n"},{"id":"163398","messageId":"7v4o74b8r5.fsf@alter.siamese.dyndns.org","threadId":"26736","inReplyTo":"20110315101045.GD3923@elie","subject":"Re: [RFC/PATCH 2/2] tests: scrub environment of GIT_* variables","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-03-15T17:20:46Z","receivedAt":"2011-03-15T17:20:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Variables from the inherited environment that are meaningful to git\n> can break tests in undesirable ways.  For example,\n>\n> \tGIT_PAGER=more sh t5400-send-pack.sh -v -i\n>\n> hangs.  So unset all environment variables in the GIT_ namespace in\n> test-lib, with a few exceptions:\n>\n> - GIT_TRACE* are useful for tracking down bugs exhibited by a failing\n>   test;\n>\n> - GIT_DEBUG* are GIT_TRACE variables by another name, practically\n>   speaking.  They should probably be tweaked to follow the\n>   GIT_TRACE_foo scheme and use trace_printf machinery some time.\n>\n> - GIT_USE_LOOKUP from v1.5.6-rc0~134^2~1 (sha1-lookup: more memory\n>   efficient search in sorted list of SHA-1, 2007-12-29) is about\n>   trying an alternate implementation strategy rather than changing\n>   semantics and it can be useful to compare performance with and\n>   without it set.\n>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n> ---\n> Thanks again.\n\nSounds sane.\n\nI am perfectly fine with the use of perl but do we know the \"perl\" binary\nfound on $PATH (as opposed to $PERL_PATH) is good to use for this purpose?\nThe features used in the scriptlet seem so bread-and-butter that I don't\nthink it would make too much of a difference, but we may want to be\nconsistent.\n\nI personally think USE_LOOKUP outlived its usefulness. It was meant to be\nan easy way to experiment if the sha1_entry_pos() lookup gives better\nperformance while looking up a pack entry, to choose one implementation\nand discard the other, but I don't think anybody actually did meaningful\nbenchmarks to decide which one to keep.\n\nPerhaps we should discard the codepath USE_LOOKUP turns on, which I\nsuspect hasn't been exercised since v1.5.6 days by anybody. An obvious\nalternative is for somebody to try using USE_LOOKUP and see if it really\ngives a better performance with large packs (and if so, always use it and\ndiscard the other codepath).\n\nObviously that is outside the scope of this patch series, but I thought I\nshould mention it before I forget.\n"},{"id":"163408","messageId":"20110315200103.GA3953@sigill.intra.peff.net","threadId":"26736","inReplyTo":"7v4o74b8r5.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC/PATCH 2/2] tests: scrub environment of GIT_* variables","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-03-15T20:01:03Z","receivedAt":"2011-03-15T20:01:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 15, 2011 at 10:20:46AM -0700, Junio C Hamano wrote:\n\n> I am perfectly fine with the use of perl but do we know the \"perl\" binary\n> found on $PATH (as opposed to $PERL_PATH) is good to use for this purpose?\n> The features used in the scriptlet seem so bread-and-butter that I don't\n> think it would make too much of a difference, but we may want to be\n> consistent.\n\nWe already make the assumption elsewhere in the tests that perl in $PATH\nis some minimal sane version (which probably means some version of perl5\nin practice). This little script looks like it should run under any\nperl5 to me.\n\n> I personally think USE_LOOKUP outlived its usefulness. It was meant to be\n> an easy way to experiment if the sha1_entry_pos() lookup gives better\n> performance while looking up a pack entry, to choose one implementation\n> and discard the other, but I don't think anybody actually did meaningful\n> benchmarks to decide which one to keep.\n> \n> Perhaps we should discard the codepath USE_LOOKUP turns on, which I\n> suspect hasn't been exercised since v1.5.6 days by anybody. An obvious\n> alternative is for somebody to try using USE_LOOKUP and see if it really\n> gives a better performance with large packs (and if so, always use it and\n> discard the other codepath).\n\nVicent asked me about it the other day with respect to doing something\nsimilar in libgit2. I tried a few basic things and never ended up\ngetting any substantially different timing (or even page faults) between\nthe two strategies. Vicent, did you do any timings where it made a\ndifference?\n\n-Peff\n"}]}