{"thread":{"id":"48429","subject":"[PATCH] t6050-replace: don't disable stdin for the whole test script","startedAt":"2018-05-07T12:04:13Z","lastAt":"2018-05-09T20:40:16Z","messageCount":3,"participants":["SZEDER Gábor","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"346864","messageId":"20180507120407.4323-1-szeder.dev@gmail.com","threadId":"48429","inReplyTo":null,"subject":"[PATCH] t6050-replace: don't disable stdin for the whole test script","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-05-07T12:04:07Z","receivedAt":"2018-05-07T12:04:13Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"The test script 't6050-replace.sh' starts off with redirecting the\nwhole test script's stdin from /dev/null.  This redirection has been\nthere since the test script was introduced in a3e8267225\n(replace_object: add a test case, 2009-01-23), but the commit message\ndoesn't explain why it was deemed necessary.  AFAICT, it has never\nbeen necessary, and t6050 runs just fine and succeeds even without it,\nnot only the current version but past versions as well.\n\nBesides being unnecessary, this redirection is also harmful, as it\nprevents the test helper functions 'test_pause' and 'debug' from\nworking properly in t6050, because we can't enter any commands to the\nshell and the debugger, respectively.\n\nSo let's remove that redirection.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n t/t6050-replace.sh | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/t/t6050-replace.sh b/t/t6050-replace.sh\nindex c630aba657..199fbc78a3 100755\n--- a/t/t6050-replace.sh\n+++ b/t/t6050-replace.sh\n@@ -4,8 +4,6 @@\n #\n test_description='Tests replace refs functionality'\n \n-exec </dev/null\n-\n . ./test-lib.sh\n . \"$TEST_DIRECTORY/lib-gpg.sh\"\n \n-- \n2.17.0.583.gcecc8b8e24\n\n"},{"id":"347029","messageId":"nycvar.QRO.7.76.6.1805081651150.77@tvgsbejvaqbjf.bet","threadId":"48429","inReplyTo":"20180507120407.4323-1-szeder.dev@gmail.com","subject":"Re: [PATCH] t6050-replace: don't disable stdin for the whole test script","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-05-08T20:53:04Z","receivedAt":"2018-05-08T20:53:23Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Gábor,\n\nOn Mon, 7 May 2018, SZEDER Gábor wrote:\n\n> The test script 't6050-replace.sh' starts off with redirecting the whole\n> test script's stdin from /dev/null.  This redirection has been there\n> since the test script was introduced in a3e8267225 (replace_object: add\n> a test case, 2009-01-23), but the commit message doesn't explain why it\n> was deemed necessary.  AFAICT, it has never been necessary, and t6050\n> runs just fine and succeeds even without it, not only the current\n> version but past versions as well.\n> \n> Besides being unnecessary, this redirection is also harmful, as it\n> prevents the test helper functions 'test_pause' and 'debug' from working\n> properly in t6050, because we can't enter any commands to the shell and\n> the debugger, respectively.\n\nThe redirection might have been necessary before 781f76b1582 (test-lib:\nredirect stdin of tests, 2011-12-15), but it definitely is not necessary\nnow.\n\nThanks,\nDscho"},{"id":"347129","messageId":"CAM0VKjmOfCNBoUh89Pr9UOSqNfuWayA3T8Fa-HySkH-icE1zYQ@mail.gmail.com","threadId":"48429","inReplyTo":"nycvar.QRO.7.76.6.1805081651150.77@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] t6050-replace: don't disable stdin for the whole test script","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-05-09T20:40:13Z","receivedAt":"2018-05-09T20:40:16Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, May 8, 2018 at 10:53 PM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> On Mon, 7 May 2018, SZEDER Gábor wrote:\n>\n>> The test script 't6050-replace.sh' starts off with redirecting the whole\n>> test script's stdin from /dev/null.  This redirection has been there\n>> since the test script was introduced in a3e8267225 (replace_object: add\n>> a test case, 2009-01-23), but the commit message doesn't explain why it\n>> was deemed necessary.  AFAICT, it has never been necessary, and t6050\n>> runs just fine and succeeds even without it, not only the current\n>> version but past versions as well.\n>>\n>> Besides being unnecessary, this redirection is also harmful, as it\n>> prevents the test helper functions 'test_pause' and 'debug' from working\n>> properly in t6050, because we can't enter any commands to the shell and\n>> the debugger, respectively.\n>\n> The redirection might have been necessary before 781f76b1582 (test-lib:\n> redirect stdin of tests, 2011-12-15), but it definitely is not necessary\n> now.\n\nThat doesn't seem to be an issue in a3e8267225 (or in any other\ncommits touching t6050 since):\n\n  $ echo foobar | ( ./t6050-replace.sh ; read input ; echo $input )\n  *   ok 1: set up buggy branch\n  *   ok 2: replace the author\n  * passed all 2 test(s)\n  foobar\n"}]}