{"thread":{"id":"35938","subject":"[PATCH v2 0/3] Easier access to index-v4","startedAt":"2014-02-23T20:49:56Z","lastAt":"2014-02-24T21:39:39Z","messageCount":8,"participants":["Thomas Gummerer","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"235208","messageId":"1393188599-5391-1-git-send-email-t.gummerer@gmail.com","threadId":"35938","inReplyTo":null,"subject":"[PATCH v2 0/3] Easier access to index-v4","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2014-02-23T20:49:56Z","receivedAt":"2014-02-23T20:49:56Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"Hi,\n\nprevious round was at $gmane/242198.\n\nThanks to Junio, Eric and Duy for comments on the previous round.\n\nSince then I've squashed the fixes suggested by Junio, added a test\nshowing what should happen if an index file is present and\nGIT_INDEX_VERSION is set and fixed the typo found by Eric.\n\nThomas Gummerer (3):\n  introduce GIT_INDEX_VERSION environment variable\n  test-lib: allow setting the index format version\n  read-cache: add index.version config variable\n\n Documentation/config.txt              |  4 ++\n Documentation/git.txt                 |  5 +++\n Makefile                              |  7 ++++\n read-cache.c                          | 38 +++++++++++++++++-\n t/t1600-index.sh                      | 76 +++++++++++++++++++++++++++++++++++\n t/t2104-update-index-skip-worktree.sh |  2 +\n t/test-lib-functions.sh               |  5 +++\n t/test-lib.sh                         |  3 ++\n 8 files changed, 139 insertions(+), 1 deletion(-)\n create mode 100755 t/t1600-index.sh\n\n-- \n1.9.0.1.ge0caaa8.dirty\n"},{"id":"235211","messageId":"1393188599-5391-2-git-send-email-t.gummerer@gmail.com","threadId":"35938","inReplyTo":"1393188599-5391-1-git-send-email-t.gummerer@gmail.com","subject":"[PATCH v2 1/3] introduce GIT_INDEX_VERSION environment variable","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2014-02-23T20:49:57Z","receivedAt":"2014-02-23T20:49:57Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"Respect a GIT_INDEX_VERSION environment variable, when a new index is\ninitialized.  Setting the environment variable will not cause existing\nindex files to be converted to another format, but will only affect\nnewly written index files.  This can be used to initialize repositories\nwith index-v4.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n---\n Documentation/git.txt |  5 +++++\n read-cache.c          | 21 ++++++++++++++++++++-\n t/t1600-index.sh      | 49 +++++++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 74 insertions(+), 1 deletion(-)\n create mode 100755 t/t1600-index.sh\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 02bbc08..27a199c 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -720,6 +720,11 @@ Git so take care if using Cogito etc.\n \tindex file. If not specified, the default of `$GIT_DIR/index`\n \tis used.\n \n+'GIT_INDEX_VERSION'::\n+\tThis environment variable allows the specification of an index\n+\tversion for new repositories.  It won't affect existing index\n+\tfiles.  By default index file version [23] is used.\n+\n 'GIT_OBJECT_DIRECTORY'::\n \tIf the object storage directory is specified via this\n \tenvironment variable then the sha1 directories are created\ndiff --git a/read-cache.c b/read-cache.c\nindex 33dd676..efc4aae 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1219,6 +1219,25 @@ static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int reall\n \n #define INDEX_FORMAT_DEFAULT 3\n \n+static unsigned int get_index_format_default(void)\n+{\n+\tchar *envversion = getenv(\"GIT_INDEX_VERSION\");\n+\tif (!envversion) {\n+\t\treturn INDEX_FORMAT_DEFAULT;\n+\t} else {\n+\t\tchar *endp;\n+\t\tunsigned int version = strtoul(envversion, &endp, 10);\n+\n+\t\tif (*endp ||\n+\t\t    version < INDEX_FORMAT_LB || INDEX_FORMAT_UB < version) {\n+\t\t\twarning(_(\"GIT_INDEX_VERSION set, but the value is invalid.\\n\"\n+\t\t\t\t  \"Using version %i\"), INDEX_FORMAT_DEFAULT);\n+\t\t\tversion = INDEX_FORMAT_DEFAULT;\n+\t\t}\n+\t\treturn version;\n+\t}\n+}\n+\n /*\n  * dev/ino/uid/gid/size are also just tracked to the low 32 bits\n  * Again - this is just a (very strong in practice) heuristic that\n@@ -1795,7 +1814,7 @@ int write_index(struct index_state *istate, int newfd)\n \t}\n \n \tif (!istate->version)\n-\t\tistate->version = INDEX_FORMAT_DEFAULT;\n+\t\tistate->version = get_index_format_default();\n \n \t/* demote version 3 to version 2 when the latter suffices */\n \tif (istate->version == 3 || istate->version == 2)\ndiff --git a/t/t1600-index.sh b/t/t1600-index.sh\nnew file mode 100755\nindex 0000000..6195c55\n--- /dev/null\n+++ b/t/t1600-index.sh\n@@ -0,0 +1,49 @@\n+#!/bin/sh\n+\n+test_description='index file specific tests'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'setup' '\n+\techo 1 >a\n+'\n+\n+test_expect_success 'bogus GIT_INDEX_VERSION issues warning' '\n+\t(\n+\t\trm -f .git/index &&\n+\t\tGIT_INDEX_VERSION=2bogus &&\n+\t\texport GIT_INDEX_VERSION &&\n+\t\tgit add a 2>&1 | sed \"s/[0-9]//\" >actual.err &&\n+\t\tsed -e \"s/ Z$/ /\" <<-\\EOF >expect.err &&\n+\t\t\twarning: GIT_INDEX_VERSION set, but the value is invalid.\n+\t\t\tUsing version Z\n+\t\tEOF\n+\t\ttest_i18ncmp expect.err actual.err\n+\t)\n+'\n+\n+test_expect_success 'out of bounds GIT_INDEX_VERSION issues warning' '\n+\t(\n+\t\trm -f .git/index &&\n+\t\tGIT_INDEX_VERSION=1 &&\n+\t\texport GIT_INDEX_VERSION &&\n+\t\tgit add a 2>&1 | sed \"s/[0-9]//\" >actual.err &&\n+\t\tsed -e \"s/ Z$/ /\" <<-\\EOF >expect.err &&\n+\t\t\twarning: GIT_INDEX_VERSION set, but the value is invalid.\n+\t\t\tUsing version Z\n+\t\tEOF\n+\t\ttest_i18ncmp expect.err actual.err\n+\t)\n+'\n+\n+test_expect_success 'no warning with bogus GIT_INDEX_VERSION and existing index' '\n+\t(\n+\t\tGIT_INDEX_VERSION=1 &&\n+\t\texport GIT_INDEX_VERSION &&\n+\t\tgit add a 2>actual.err &&\n+\t\t>expect.err &&\n+\t\ttest_i18ncmp expect.err actual.err\n+\t)\n+'\n+\n+test_done\n-- \n1.9.0.1.ge0caaa8.dirty\n"},{"id":"235209","messageId":"1393188599-5391-3-git-send-email-t.gummerer@gmail.com","threadId":"35938","inReplyTo":"1393188599-5391-1-git-send-email-t.gummerer@gmail.com","subject":"[PATCH v2 2/3] test-lib: allow setting the index format version","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2014-02-23T20:49:58Z","receivedAt":"2014-02-23T20:49:58Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"Allow adding a TEST_GIT_INDEX_VERSION variable to config.mak to set the\nindex version with which the test suite should be run.\n\nIf it isn't set, the default version given in the source code is\nused (currently version 3).\n\nTo avoid breakages with index versions other than [23], also set the\nindex version under which t2104 is run to 3.  This test only tests\nfunctionality specific to version 2 and 3 of the index file and would\nfail if the test suite is run with any other version.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n---\n Makefile                              | 7 +++++++\n t/t2104-update-index-skip-worktree.sh | 2 ++\n t/test-lib-functions.sh               | 5 +++++\n t/test-lib.sh                         | 3 +++\n 4 files changed, 17 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex dddaf4f..5caa3b2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -342,6 +342,10 @@ all::\n # Define DEFAULT_HELP_FORMAT to \"man\", \"info\" or \"html\"\n # (defaults to \"man\") if you want to have a different default when\n # \"git help\" is called without a parameter specifying the format.\n+#\n+# Define TEST_GIT_INDEX_VERSION to 2, 3 or 4 to run the test suite\n+# with a different indexfile format version.  If it isn't set the index\n+# file format used is index-v[23].\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n@@ -2222,6 +2226,9 @@ endif\n ifdef GIT_PERF_MAKE_OPTS\n \t@echo GIT_PERF_MAKE_OPTS=\\''$(subst ','\\'',$(subst ','\\'',$(GIT_PERF_MAKE_OPTS)))'\\' >>$@\n endif\n+ifdef TEST_GIT_INDEX_VERSION\n+\t@echo TEST_GIT_INDEX_VERSION=\\''$(subst ','\\'',$(subst ','\\'',$(TEST_GIT_INDEX_VERSION)))'\\' >>$@\n+endif\n \n ### Detect Python interpreter path changes\n ifndef NO_PYTHON\ndiff --git a/t/t2104-update-index-skip-worktree.sh b/t/t2104-update-index-skip-worktree.sh\nindex 1d0879b..29c1fb1 100755\n--- a/t/t2104-update-index-skip-worktree.sh\n+++ b/t/t2104-update-index-skip-worktree.sh\n@@ -7,6 +7,8 @@ test_description='skip-worktree bit test'\n \n . ./test-lib.sh\n \n+test_set_index_version 3\n+\n cat >expect.full <<EOF\n H 1\n H 2\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex aeae3ca..0bf1e63 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -32,6 +32,11 @@ test_set_editor () {\n \texport EDITOR\n }\n \n+test_set_index_version () {\n+    GIT_INDEX_VERSION=\"$1\"\n+    export GIT_INDEX_VERSION\n+}\n+\n test_decode_color () {\n \tawk '\n \t\tfunction name(n) {\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 1531c24..492f81f 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -108,6 +108,9 @@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n export EDITOR\n \n+GIT_INDEX_VERSION=\"$TEST_GIT_INDEX_VERSION\"\n+export GIT_INDEX_VERSION\n+\n # Add libc MALLOC and MALLOC_PERTURB test\n # only if we are not executing the test with valgrind\n if expr \" $GIT_TEST_OPTS \" : \".* --valgrind \" >/dev/null ||\n-- \n1.9.0.1.ge0caaa8.dirty\n"},{"id":"235210","messageId":"1393188599-5391-4-git-send-email-t.gummerer@gmail.com","threadId":"35938","inReplyTo":"1393188599-5391-1-git-send-email-t.gummerer@gmail.com","subject":"[PATCH v2 3/3] read-cache: add index.version config variable","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2014-02-23T20:49:59Z","receivedAt":"2014-02-23T20:49:59Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"Add a config variable that allows setting the default index version when\ninitializing a new index file.  Similar to the GIT_INDEX_VERSION\nenvironment variable this only affects new index files.\n\nSigned-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n---\n Documentation/config.txt |  4 ++++\n read-cache.c             | 35 ++++++++++++++++++++++++++---------\n t/t1600-index.sh         | 27 +++++++++++++++++++++++++++\n 3 files changed, 57 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 5f4d793..98200aa 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1601,6 +1601,10 @@ imap::\n \tThe configuration variables in the 'imap' section are described\n \tin linkgit:git-imap-send[1].\n \n+index.version::\n+\tSpecify the version with which new index files should be\n+\tinitialized.  This does not affect existing repositories.\n+\n init.templatedir::\n \tSpecify the directory from which templates will be copied.\n \t(See the \"TEMPLATE DIRECTORY\" section of linkgit:git-init[1].)\ndiff --git a/read-cache.c b/read-cache.c\nindex efc4aae..6bc9724 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1219,23 +1219,40 @@ static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int reall\n \n #define INDEX_FORMAT_DEFAULT 3\n \n+static int index_format_config(const char *var, const char *value, void *cb)\n+{\n+\tunsigned int *version = cb;\n+\tif (!strcmp(var, \"index.version\")) {\n+\t\t*version = git_config_int(var, value);\n+\t\treturn 0;\n+\t}\n+\treturn 1;\n+}\n+\n static unsigned int get_index_format_default(void)\n {\n \tchar *envversion = getenv(\"GIT_INDEX_VERSION\");\n-\tif (!envversion) {\n-\t\treturn INDEX_FORMAT_DEFAULT;\n-\t} else {\n-\t\tchar *endp;\n-\t\tunsigned int version = strtoul(envversion, &endp, 10);\n+\tchar *endp;\n+\tunsigned int version = INDEX_FORMAT_DEFAULT;\n \n-\t\tif (*endp ||\n-\t\t    version < INDEX_FORMAT_LB || INDEX_FORMAT_UB < version) {\n-\t\t\twarning(_(\"GIT_INDEX_VERSION set, but the value is invalid.\\n\"\n+\tif (!envversion) {\n+\t\tgit_config(index_format_config, &version);\n+\t\tif (version < INDEX_FORMAT_LB || INDEX_FORMAT_UB < version) {\n+\t\t\twarning(_(\"index.version set, but the value is invalid.\\n\"\n \t\t\t\t  \"Using version %i\"), INDEX_FORMAT_DEFAULT);\n-\t\t\tversion = INDEX_FORMAT_DEFAULT;\n+\t\t\treturn INDEX_FORMAT_DEFAULT;\n \t\t}\n \t\treturn version;\n \t}\n+\n+\tversion = strtoul(envversion, &endp, 10);\n+\tif (*endp ||\n+\t    version < INDEX_FORMAT_LB || INDEX_FORMAT_UB < version) {\n+\t\twarning(_(\"GIT_INDEX_VERSION set, but the value is invalid.\\n\"\n+\t\t\t  \"Using version %i\"), INDEX_FORMAT_DEFAULT);\n+\t\tversion = INDEX_FORMAT_DEFAULT;\n+\t}\n+\treturn version;\n }\n \n /*\ndiff --git a/t/t1600-index.sh b/t/t1600-index.sh\nindex 6195c55..079d241 100755\n--- a/t/t1600-index.sh\n+++ b/t/t1600-index.sh\n@@ -46,4 +46,31 @@ test_expect_success 'no warning with bogus GIT_INDEX_VERSION and existing index'\n \t)\n '\n \n+test_expect_success 'out of bounds index.version issues warning' '\n+\t(\n+\t\tsane_unset GIT_INDEX_VERSION &&\n+\t\trm -f .git/index &&\n+\t\tgit config --add index.version 1 &&\n+\t\tgit add a 2>&1 | sed \"s/[0-9]//\" >actual.err &&\n+\t\tsed -e \"s/ Z$/ /\" <<-\\EOF >expect.err &&\n+\t\t\twarning: index.version set, but the value is invalid.\n+\t\t\tUsing version Z\n+\t\tEOF\n+\t\ttest_i18ncmp expect.err actual.err\n+\t)\n+'\n+\n+test_expect_success 'GIT_INDEX_VERSION takes precedence over config' '\n+\t(\n+\t\trm -f .git/index &&\n+\t\tGIT_INDEX_VERSION=4 &&\n+\t\texport GIT_INDEX_VERSION &&\n+\t\tgit config --add index.version 2 &&\n+\t\tgit add a 2>&1 &&\n+\t\techo 4 >expect &&\n+\t\ttest-index-version <.git/index >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n test_done\n-- \n1.9.0.1.ge0caaa8.dirty\n"},{"id":"235276","messageId":"xmqqios49yyq.fsf@gitster.dls.corp.google.com","threadId":"35938","inReplyTo":"1393188599-5391-1-git-send-email-t.gummerer@gmail.com","subject":"Re: [PATCH v2 0/3] Easier access to index-v4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-02-24T17:56:13Z","receivedAt":"2014-02-24T17:56:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Gummerer <t.gummerer@gmail.com> writes:\n\n> previous round was at $gmane/242198.\n>\n> Since then I've squashed the fixes suggested by Junio, added a test\n> showing what should happen if an index file is present and\n> GIT_INDEX_VERSION is set and fixed the typo found by Eric.\n\nLooks good; thanks.\n"},{"id":"235284","messageId":"xmqqwqgk8fsq.fsf@gitster.dls.corp.google.com","threadId":"35938","inReplyTo":"xmqqios49yyq.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2 0/3] Easier access to index-v4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-02-24T19:35:33Z","receivedAt":"2014-02-24T19:35:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Thomas Gummerer <t.gummerer@gmail.com> writes:\n>\n>> previous round was at $gmane/242198.\n>>\n>> Since then I've squashed the fixes suggested by Junio, added a test\n>> showing what should happen if an index file is present and\n>> GIT_INDEX_VERSION is set and fixed the typo found by Eric.\n>\n> Looks good; thanks.\n\nTests, seem to leak these unnecessary diag (not limited to t0010).\n\n    sh t0010-racy-git.sh \n    warning: GIT_INDEX_VERSION set, but the value is invalid.\n    Using version 3\n    ok 1 - Racy GIT trial #0 part A\n    ok 2 - Racy GIT trial #0 part B\n    warning: GIT_INDEX_VERSION set, but the value is invalid.\n    Using version 3\n    ...\n    # passed all 10 test(s)\n    1..10\n\n\nThe same thing under prove.\n\n    *** prove ***\n    t0010-racy-git.sh .. warning: GIT_INDEX_VERSION set, but the value is invalid.\n    Using version 3\n    t0010-racy-git.sh .. 2/? warning: GIT_INDEX_VERSION set, but the value is invalid.\n    Using version 3\n    t0010-racy-git.sh .. 4/? warning: GIT_INDEX_VERSION set, but the value is invalid.\n    Using version 3\n    t0010-racy-git.sh .. 6/? warning: GIT_INDEX_VERSION set, but the value is invalid.\n    Using version 3\n    t0010-racy-git.sh .. 8/? warning: GIT_INDEX_VERSION set, but the value is invalid.\n    Using version 3\n    t0010-racy-git.sh .. ok    \n    All tests successful.\n\n\nI suspect the real culprit is the early part in test-lib.sh that\nsets GIT_INDEX_VERSION explicitly from TEST_GIT_INDEX_VERSION when\nthe latter is not even specified.\n\nSomething along this line, perhaps?\n\n t/test-lib.sh | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 492f81f..01a98cb 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -108,8 +108,11 @@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n export EDITOR\n \n-GIT_INDEX_VERSION=\"$TEST_GIT_INDEX_VERSION\"\n-export GIT_INDEX_VERSION\n+if test -n \"${TEST_GIT_INDEX_VERSION+isset}\"\n+then\n+\tGIT_INDEX_VERSION=\"$TEST_GIT_INDEX_VERSION\"\n+\texport GIT_INDEX_VERSION\n+fi\n \n # Add libc MALLOC and MALLOC_PERTURB test\n # only if we are not executing the test with valgrind\n"},{"id":"235286","messageId":"87y510s2xh.fsf@hank.lan","threadId":"35938","inReplyTo":"xmqqwqgk8fsq.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2 0/3] Easier access to index-v4","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2014-02-24T19:53:14Z","receivedAt":"2014-02-24T19:53:14Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Thomas Gummerer <t.gummerer@gmail.com> writes:\n>>\n>>> previous round was at $gmane/242198.\n>>>\n>>> Since then I've squashed the fixes suggested by Junio, added a test\n>>> showing what should happen if an index file is present and\n>>> GIT_INDEX_VERSION is set and fixed the typo found by Eric.\n>>\n>> Looks good; thanks.\n>\n> Tests, seem to leak these unnecessary diag (not limited to t0010).\n>\n>     sh t0010-racy-git.sh \n>     warning: GIT_INDEX_VERSION set, but the value is invalid.\n>     Using version 3\n>     ok 1 - Racy GIT trial #0 part A\n>     ok 2 - Racy GIT trial #0 part B\n>     warning: GIT_INDEX_VERSION set, but the value is invalid.\n>     Using version 3\n>     ...\n>     # passed all 10 test(s)\n>     1..10\n>\n>\n> The same thing under prove.\n>\n>     *** prove ***\n>     t0010-racy-git.sh .. warning: GIT_INDEX_VERSION set, but the value is invalid.\n>     Using version 3\n>     t0010-racy-git.sh .. 2/? warning: GIT_INDEX_VERSION set, but the value is invalid.\n>     Using version 3\n>     t0010-racy-git.sh .. 4/? warning: GIT_INDEX_VERSION set, but the value is invalid.\n>     Using version 3\n>     t0010-racy-git.sh .. 6/? warning: GIT_INDEX_VERSION set, but the value is invalid.\n>     Using version 3\n>     t0010-racy-git.sh .. 8/? warning: GIT_INDEX_VERSION set, but the value is invalid.\n>     Using version 3\n>     t0010-racy-git.sh .. ok    \n>     All tests successful.\n>\n>\n> I suspect the real culprit is the early part in test-lib.sh that\n> sets GIT_INDEX_VERSION explicitly from TEST_GIT_INDEX_VERSION when\n> the latter is not even specified.\n>\n> Something along this line, perhaps?\n\nSorry about this, I didn't run the test suite without\nTEST_GIT_INDEX_VERSION in config.mak which I obviously should have.\n\nYes, this looks good to me, thanks!\n\n>  t/test-lib.sh | 7 +++++--\n>  1 file changed, 5 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 492f81f..01a98cb 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -108,8 +108,11 @@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n>  export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n>  export EDITOR\n>  \n> -GIT_INDEX_VERSION=\"$TEST_GIT_INDEX_VERSION\"\n> -export GIT_INDEX_VERSION\n> +if test -n \"${TEST_GIT_INDEX_VERSION+isset}\"\n> +then\n> +\tGIT_INDEX_VERSION=\"$TEST_GIT_INDEX_VERSION\"\n> +\texport GIT_INDEX_VERSION\n> +fi\n>  \n>  # Add libc MALLOC and MALLOC_PERTURB test\n>  # only if we are not executing the test with valgrind\n"},{"id":"235301","messageId":"xmqqtxbo6vhg.fsf@gitster.dls.corp.google.com","threadId":"35938","inReplyTo":"87y510s2xh.fsf@hank.lan","subject":"Re: [PATCH v2 0/3] Easier access to index-v4","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-02-24T21:39:39Z","receivedAt":"2014-02-24T21:39:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Gummerer <t.gummerer@gmail.com> writes:\n\n>> Something along this line, perhaps?\n>\n> Sorry about this, I didn't run the test suite without\n> TEST_GIT_INDEX_VERSION in config.mak which I obviously should have.\n>\n> Yes, this looks good to me, thanks!\n\nOK, will squash it (but using \"VAR:+isset\" instead of \"VAR+isset\" to\nallow people to set it to empty to disable) into the relevant patch.\n\nThanks.\n"}]}