{"thread":{"id":"3860","subject":"Re: Test fails on ubuntu breezy","startedAt":"2006-04-13T11:54:47Z","lastAt":"2006-04-15T15:43:23Z","messageCount":6,"participants":["linux@horizon.com","Junio C Hamano","Aneesh Kumar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"18610","messageId":"20060413115447.11819.qmail@science.horizon.com","threadId":"3860","inReplyTo":null,"subject":"Re: Test fails on ubuntu breezy","fromName":"","fromEmail":"linux@horizon.com","sentAt":"2006-04-13T11:54:47Z","receivedAt":"2006-04-13T11:54:47Z","isPatch":false,"sender":{"key":"linux@horizon.com","avatar":null},"body":"I've recently encountered the same problem with t/t3600-rm.sh step 9,\nbut I put it down to compiling as root.\n\nBasically, the chmod of the directory didn't stop the delete from\nhappening, since I had umask 002 and it was g+w.\n\nAnyway, that test is fragile.\n"},{"id":"18618","messageId":"7vpsjl1ezb.fsf@assigned-by-dhcp.cox.net","threadId":"3860","inReplyTo":"20060413115447.11819.qmail@science.horizon.com","subject":"Re: Test fails on ubuntu breezy","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-13T18:56:40Z","receivedAt":"2006-04-13T18:56:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"linux@horizon.com writes:\n\n> I've recently encountered the same problem with t/t3600-rm.sh step 9,\n> but I put it down to compiling as root.\n>\n> Basically, the chmod of the directory didn't stop the delete from\n> happening, since I had umask 002 and it was g+w.\n>\n> Anyway, that test is fragile.\n\nIndeed.  I am not sure about test #5, but here is my stab at\nfixing test #9.\n\n-- >8 --\n[PATCH] t3600-rm: skip failed-remove test when we cannot make an unremovable file\n\nWhen running t3600-rm test under fakeroot (or as root), we\ncannot make a file unremovable with \"chmod a-w .\".  Detect this\ncase early and skip that test.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex d1947e1..acaa4d6 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -23,6 +23,16 @@ else\n     test_tabs=n\n fi\n \n+# Later we will try removing an unremovable path to make sure\n+# git-rm barfs, but if the test is run as root that cannot be\n+# arranged.\n+: >test-file\n+chmod a-w .\n+rm -f test-file\n+test -f test-file && test_failed_remove=y\n+chmod 775 .\n+rm -f test-file\n+\n test_expect_success \\\n     'Pre-check that foo exists and is in index before git-rm foo' \\\n     '[ -f foo ] && git-ls-files --error-unmatch foo'\n@@ -56,12 +66,14 @@ test \"$test_tabs\" = y && test_expect_suc\n     \"git-rm -f 'space embedded' 'tab\tembedded' 'newline\n embedded'\"\n \n-if test \"$test_tabs\" = y; then\n-chmod u-w .\n+if test \"$test_failed_remove\" = y; then\n+chmod a-w .\n test_expect_failure \\\n     'Test that \"git-rm -f\" fails if its rm fails' \\\n     'git-rm -f baz'\n-chmod u+w .\n+chmod 775 .\n+else\n+    test_expect_success 'skipping removal failure (perhaps running as root?)' :\n fi\n \n test_expect_success \\\n"},{"id":"18679","messageId":"cc723f590604142347p7646aa40r52506a0d85b7d817@mail.gmail.com","threadId":"3860","inReplyTo":"7vpsjl1ezb.fsf@assigned-by-dhcp.cox.net","subject":"Re: Test fails on ubuntu breezy","fromName":"Aneesh Kumar","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-04-15T06:47:03Z","receivedAt":"2006-04-15T06:47:03Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"I am still having failure with the top of the tree. I guess it is\nbecause git rm exit with status 0.\n\nkvaneesh@home:/tmp/test$ git rm -f a\nrm: cannot remove `a': Permission denied\nkvaneesh@home:/tmp/test$ echo $?\n0\nkvaneesh@home:/tmp/test$\n\n\nI am attaching the logs below\n\n-aneesh\n"},{"id":"18680","messageId":"7vbqv3jo77.fsf@assigned-by-dhcp.cox.net","threadId":"3860","inReplyTo":"cc723f590604142347p7646aa40r52506a0d85b7d817@mail.gmail.com","subject":"Re: Test fails on ubuntu breezy","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-15T07:24:44Z","receivedAt":"2006-04-15T07:24:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Aneesh Kumar\" <aneesh.kumar@gmail.com> writes:\n\n> I am still having failure with the top of the tree. I guess it is\n> because git rm exit with status 0.\n\nPlease don't guess, but validate (I know you are capable of\ndoing so).\n\nWhat I would do to see what is happening would be to do\nsomething like the attached patch and re-run the test.\n\nBTW, you did \"sh -x t3600-rm.sh\" which is very good.  I usually\ndo it when debugging hard-to-debug testsuite problem, especially\nones which I do not know intimately, written by somebody else,\nlike this:\n\n\tsh -x tXXXX-that-test.sh -i\n\nThe -i option makes it immediately stop at the first test failure.\n\n-- >8 --\ndiff --git a/git-rm.sh b/git-rm.sh\nindex fda4541..622ffca 100755\n--- a/git-rm.sh\n+++ b/git-rm.sh\n@@ -43,6 +43,8 @@ case \"$#\" in\n \t;;\n esac\n \n+set -x\n+\n if test -f \"$GIT_DIR/info/exclude\"\n then\n \tgit-ls-files -z \\\n"},{"id":"18681","messageId":"cc723f590604150033t53fa1af5wa10f93a059f4a9ce@mail.gmail.com","threadId":"3860","inReplyTo":"cc723f590604142347p7646aa40r52506a0d85b7d817@mail.gmail.com","subject":"Re: Test fails on ubuntu breezy","fromName":"Aneesh Kumar","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-04-15T07:33:00Z","receivedAt":"2006-04-15T07:33:00Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"On 4/15/06, Aneesh Kumar <aneesh.kumar@gmail.com> wrote:\n> I am still having failure with the top of the tree. I guess it is\n> because git rm exit with status 0.\n>\n> kvaneesh@home:/tmp/test$ git rm -f a\n> rm: cannot remove `a': Permission denied\n> kvaneesh@home:/tmp/test$ echo $?\n> 0\n>\n\n\nI think it is xargs\nkvaneesh@home:/tmp/test$ echo a | xargs rm\nrm: cannot remove `a': Permission denied\nkvaneesh@home:/tmp/test$ echo $?\n0\nkvaneesh@home:/tmp/test$\n\non ubuntu Dapper it returns 123 status.   I will file a bug report\nagainst xargs.\n\n-aneesh\n"},{"id":"18700","messageId":"cc723f590604150843v33a52bb4ocab5de0482effc92@mail.gmail.com","threadId":"3860","inReplyTo":"7vbqv3jo77.fsf@assigned-by-dhcp.cox.net","subject":"Re: Test fails on ubuntu breezy","fromName":"Aneesh Kumar","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-04-15T15:43:23Z","receivedAt":"2006-04-15T15:43:23Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"On 4/15/06, Junio C Hamano <junkio@cox.net> wrote:\n> \"Aneesh Kumar\" <aneesh.kumar@gmail.com> writes:\n>\n> > I am still having failure with the top of the tree. I guess it is\n> > because git rm exit with status 0.\n>\n> Please don't guess, but validate (I know you are capable of\n> doing so).\n>\n>\n\nI did :). I sent another mail explaining it is xargs in breezy. I also\nfiled a bug. But they are not going to fix it in breezy. The below is\nthe response i got.\n\n\"As Ubuntu Breezy is a released probuct, only security-related fixes\nare accepted. If you think this fix is important enough, you could\ndiscuss the issue with the maintainers of Ubuntu backports, and see if\nthey are interested in making a backport available: \"\n\nRight now i am commenting out the test case to build the .deb file.\n\n-aneesh\n"}]}