{"thread":{"id":"34626","subject":"[PATCH revised] git_mkstemps: add test suite test","startedAt":"2013-08-06T18:05:01Z","lastAt":"2013-08-06T20:50:11Z","messageCount":5,"participants":["Dale R. Worley","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"224695","messageId":"201308061805.r76I51If026086@freeze.ariadne.com","threadId":"34626","inReplyTo":null,"subject":"[PATCH revised] git_mkstemps: add test suite test","fromName":"Dale R. Worley","fromEmail":"worley@alum.mit.edu","sentAt":"2013-08-06T18:05:01Z","receivedAt":"2013-08-06T18:05:01Z","isPatch":true,"sender":{"key":"worley@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/19911107?v=4"},"body":"Commit a2cb86 (\"git_mkstemps: correctly test return value of open()\",\n12 Jul 2013) fixes a bug regarding testing the return of an open()\ncall for success/failure.  Add a testsuite test for that fix.  The\ntest exercises a situation where that open() is known to return 0.\n\nSigned-off-by: Dale Worley <worley@ariadne.com>\n---\nThis version of the patch cleans up a number of errors in my previous\nversion (which were ultimately due to my faulty updating of my master\nbranch).  The commit that added the open() test is now correctly\ndescribed.  Since the test was not present in the test suite at all,\nthe patch is described as adding the test rather than improving it.\n\na2cb86 is on branch tr/fd-gotcha-fixes, but that has been merged into\nmaster now.\n\n(Thanks for your patience with this.)\n\nDale\n\n t/t0070-fundamental.sh | 7 +++++++\n 1 file changed, 7 insertions(+)\n\ndiff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\nindex 986b2a8..d427f3a 100755\n--- a/t/t0070-fundamental.sh\n+++ b/t/t0070-fundamental.sh\n@@ -25,6 +25,13 @@ test_expect_success POSIXPERM,SANITY 'mktemp to unwritable directory prints file\n \tgrep \"cannotwrite/test\" err\n '\n \n+test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '\n+\tgit init &&\n+\techo Test. >test-file &&\n+\tgit add test-file &&\n+\tgit commit -m Message. <&-\n+'\n+\n test_expect_success 'check for a bug in the regex routines' '\n \t# if this test fails, re-build git with NO_REGEX=1\n \ttest-regex\n-- \n1.8.4.rc1.24.gd407a5c\n"},{"id":"224696","messageId":"7vsiymfzuh.fsf@alter.siamese.dyndns.org","threadId":"34626","inReplyTo":"201308061805.r76I51If026086@freeze.ariadne.com","subject":"Re: [PATCH revised] git_mkstemps: add test suite test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-06T18:17:42Z","receivedAt":"2013-08-06T18:17:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"worley@alum.mit.edu (Dale R. Worley) writes:\n\n> Commit a2cb86 (\"git_mkstemps: correctly test return value of open()\",\n> 12 Jul 2013) fixes a bug regarding testing the return of an open()\n> call for success/failure.  Add a testsuite test for that fix.  The\n> test exercises a situation where that open() is known to return 0.\n>\n> Signed-off-by: Dale Worley <worley@ariadne.com>\n> ---\n> This version of the patch cleans up a number of errors in my previous\n> version (which were ultimately due to my faulty updating of my master\n> branch).  The commit that added the open() test is now correctly\n> described.  Since the test was not present in the test suite at all,\n> the patch is described as adding the test rather than improving it.\n>\n> a2cb86 is on branch tr/fd-gotcha-fixes, but that has been merged into\n> master now.\n\nThanks. I thought I've already queued \n\nMessage-ID: <7vfvuokpr0.fsf@alter.siamese.dyndns.org>\naka \nhttp://article.gmane.org/gmane.comp.version-control.git/231680\n\nwhich tests\n\n    git commit --allow-empty -m message <&-\n\n> +test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '\n> +\tgit init &&\n\nThis does not do anything useful; you are in the test playpen aka\n\"trash\" which is an already initialized git repository.\n\n> +\techo Test. >test-file &&\n> +\tgit add test-file &&\n\nYou do not have to have extra contents...\n\n> +\tgit commit -m Message. <&-\n\n...you can do with just \"--allow-empty\" instead.\n"},{"id":"224701","messageId":"201308061859.r76IxMLl027315@freeze.ariadne.com","threadId":"34626","inReplyTo":"7vsiymfzuh.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH revised] git_mkstemps: add test suite test","fromName":"Dale R. Worley","fromEmail":"worley@alum.mit.edu","sentAt":"2013-08-06T18:59:22Z","receivedAt":"2013-08-06T18:59:22Z","isPatch":true,"sender":{"key":"worley@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/19911107?v=4"},"body":"> From: Junio C Hamano <gitster@pobox.com>\n> \n> Thanks. I thought I've already queued \n> \n> Message-ID: <7vfvuokpr0.fsf@alter.siamese.dyndns.org>\n> aka \n> http://article.gmane.org/gmane.comp.version-control.git/231680\n> \n> which tests\n> \n>     git commit --allow-empty -m message <&-\n\nMy mistake...  I've been so intent on revising my repository and\nrewriting the patch that I overlooked that you'd done the revision\nalready.\n\nDale\n"},{"id":"224702","messageId":"201308061902.r76J2W33027399@freeze.ariadne.com","threadId":"34626","inReplyTo":"7vsiymfzuh.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH revised] git_mkstemps: add test suite test","fromName":"Dale R. Worley","fromEmail":"worley@alum.mit.edu","sentAt":"2013-08-06T19:02:32Z","receivedAt":"2013-08-06T19:02:32Z","isPatch":true,"sender":{"key":"worley@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/19911107?v=4"},"body":">     git commit --allow-empty -m message <&-\n\nThough as of [fb56570] \"Sync with maint to grab trivial doc fixes\",\nthat test doesn't fail for me if I revert to\n\n\t\tfd = open(pattern, O_CREAT | O_EXCL | O_RDWR, mode);\n\t\tif (fd > 0)\n\t\t\treturn fd;\n\nI haven't been watching the code changes carefully; has there been a\nfix that is expected to cause that?\n\nDale\n"},{"id":"224710","messageId":"7vd2pqfssc.fsf@alter.siamese.dyndns.org","threadId":"34626","inReplyTo":"201308061902.r76J2W33027399@freeze.ariadne.com","subject":"Re: [PATCH revised] git_mkstemps: add test suite test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-06T20:50:11Z","receivedAt":"2013-08-06T20:50:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"worley@alum.mit.edu (Dale R. Worley) writes:\n\n>>     git commit --allow-empty -m message <&-\n>\n> Though as of [fb56570] \"Sync with maint to grab trivial doc fixes\",\n> that test doesn't fail for me if I revert to\n>\n> \t\tfd = open(pattern, O_CREAT | O_EXCL | O_RDWR, mode);\n> \t\tif (fd > 0)\n> \t\t\treturn fd;\n>\n> I haven't been watching the code changes carefully; has there been a\n> fix that is expected to cause that?\n>\n> Dale\n\nThat is because a11c3964 (git: ensure 0/1/2 are open in main(),\n2013-07-16) happened in the meantime, I think.\n"}]}