{"thread":{"id":"4372","subject":"More information on git for Cygwin x86-64","startedAt":"2006-06-01T23:44:10Z","lastAt":"2006-06-02T06:37:15Z","messageCount":2,"participants":["Tim O'Callaghan","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"21069","messageId":"20060601234410.GA3408@Zangband","threadId":"4372","inReplyTo":null,"subject":"More information on git for Cygwin x86-64","fromName":"Tim O'Callaghan","fromEmail":"timo@dspsrv.com","sentAt":"2006-06-01T23:44:10Z","receivedAt":"2006-06-01T23:44:10Z","isPatch":false,"sender":{"key":"timo@dspsrv.com","avatar":null},"body":"After some investigation, it looks like the problem is to do with the\nindex.lock file. I think it may have something to do with with the\nrename function in index.c.\n\nAs far as i can tell index.lock should not exist after any git\ncall. An atexit() call is registered remove it when it is created, so\nthis should ensure it gets removed. Unfortunately that is not what\nhappens in this case.\n\nA quick check with an unlink() before the rename in index.c, worked\nfor the first failure in t0000-basic, but not the next one.\n\nThe only relevant reference I could find in the list archives is:\nhttp://www.gelato.unsw.edu.au/archives/git/0510/10188.html\n\nThe attached patch has two fixes. The first is a check to see if\ncygwin is installed, and if so, to ensure that the script uses cygwin\nUnix style find, rather than the win2k find.\n\nThe second adds a test_warning_ function to the test library. Not sure\nhow useful th may be to everyone else, but it works for me. This\nchecks to see if the index.lock still exists, and adds a simple\n'warning' category to the tests.\n\nTim.\n\n\ndiff --git a/t/README b/t/README\nindex ac5a3ac..d278702 100644\n--- a/t/README\n+++ b/t/README\n@@ -52,7 +52,7 @@ (or -i) command line argument to the tes\n \n --immediate::\n \tThis causes the test to immediately exit upon the first\n-\tfailed test.\n+\tfailed test or warning.\n \n \n Naming Tests\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 05f6e79..e24cab0 100755\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -80,6 +80,7 @@ fi\n \n test_failure=0\n test_count=0\n+warning_count=0\n \n trap 'echo >&5 \"FATAL: Unexpected exit with code $?\"; exit 1' exit\n \n@@ -101,6 +102,17 @@ test_failure_ () {\n \ttest \"$immediate\" = \"\" || { trap - exit; exit 1; }\n }\n \n+test_warning_ () {\n+    if [ -e \".git/index.lock\" ]\n+    then \n+        say \"Warn $warning_count: file .git/index.lock exists\"\n+        warning_count=$(expr \"$warning_count\" + 1)\n+    fi\n+    if [ \"$immediate\" != \"\" -a $warning_count -gt 0 ]\n+    then \n+        trap - exit; exit 1;\n+    fi\n+}\n \n test_debug () {\n \ttest \"$debug\" = \"\" || eval \"$1\"\n@@ -123,6 +135,7 @@ test_expect_failure () {\n \telse\n \t\ttest_failure_ \"$@\"\n \tfi\n+        test_warning_\n }\n \n test_expect_success () {\n@@ -136,6 +149,7 @@ test_expect_success () {\n \telse\n \t\ttest_failure_ \"$@\"\n \tfi\n+        test_warning_\n }\n \n test_expect_code () {\n@@ -149,6 +163,7 @@ test_expect_code () {\n \telse\n \t\ttest_failure_ \"$@\"\n \tfi\n+        test_warning_\n }\n \n # Most tests can use the created repository, but some amy need to create more.\n@@ -178,13 +193,12 @@ test_done () {\n \t\t# The Makefile provided will clean this test area so\n \t\t# we will leave things as they are.\n \n-\t\tsay \"passed all $test_count test(s)\"\n+\t\tsay \"passed all $test_count test(s) with $warning_count warning(s)\"\n \t\texit 0 ;;\n \n \t*)\n-\t\tsay \"failed $test_failure among $test_count test(s)\"\n+\t\tsay \"failed $test_failure among $test_count test(s) with $warning_count warning(s)\"\n \t\texit 1 ;;\n-\n \tesac\n }\n \n@@ -210,6 +224,13 @@ test -d ../templates/blt || {\n \terror \"You haven't built things yet, have you?\"\n }\n \n+# make sure the cygwin find is used instead of the win2k find.\n+if [ $(uname -o 2>/dev/null || echo not) = \"Cygwin\" ]\n+then\n+    alias find=\"/bin/find\" \n+fi\n+\n+\n # Test repository\n test=trash\n rm -fr \"$test\"\n"},{"id":"21089","messageId":"81b0412b0606012337o3b005cd6wb88b0d1859d5369f@mail.gmail.com","threadId":"4372","inReplyTo":"20060601234410.GA3408@Zangband","subject":"Re: More information on git for Cygwin x86-64","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-06-02T06:37:15Z","receivedAt":"2006-06-02T06:37:15Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 6/2/06, Tim O'Callaghan <timo@dspsrv.com> wrote:\n> After some investigation, it looks like the problem is to do with the\n> index.lock file. I think it may have something to do with with the\n> rename function in index.c.\n\nDoes setting \"NO_MMAP = YesPlease\" in config.mak helps you?\nThe problem this option solves has to do with stupid open\nfile behaviour in windows.\n"}]}