{"thread":{"id":"4333","subject":"[PATCH] Remove unnecessary ouput from t3600-rm.","startedAt":"2006-05-29T07:16:46Z","lastAt":"2006-05-29T08:06:48Z","messageCount":3,"participants":["Shawn Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"20870","messageId":"20060529071646.GC6061@spearce.org","threadId":"4333","inReplyTo":null,"subject":"[PATCH] Remove unnecessary ouput from t3600-rm.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-05-29T07:16:46Z","receivedAt":"2006-05-29T07:16:46Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Moved the output of the setup commits and the test-file rm check to\nfile descriptors 3 and 4 hiding their messages unless -v is given.\nThis makes the test suite look a little cleaner when the rm test-file\nsetup step fails (and was probably expected to fail).\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n t/t3600-rm.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex acaa4d6..5b6bf61 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -10,14 +10,14 @@ test_description='Test of the various op\n # Setup some files to be removed, some with funny characters\n touch -- foo bar baz 'space embedded' -q\n git-add -- foo bar baz 'space embedded' -q\n-git-commit -m \"add normal files\"\n+git-commit -m \"add normal files\" >&3 2>&4\n test_tabs=y\n if touch -- 'tab\tembedded' 'newline\n embedded'\n then\n git-add -- 'tab\tembedded' 'newline\n embedded'\n-git-commit -m \"add files with tabs and newlines\"\n+git-commit -m \"add files with tabs and newlines\" >&3 2>&4\n else\n     say 'Your filesystem does not allow tabs in filenames.'\n     test_tabs=n\n@@ -28,7 +28,7 @@ # git-rm barfs, but if the test is run a\n # arranged.\n : >test-file\n chmod a-w .\n-rm -f test-file\n+rm -f test-file >&3 2>&4\n test -f test-file && test_failed_remove=y\n chmod 775 .\n rm -f test-file\n-- \n1.3.3.g45d8\n"},{"id":"20873","messageId":"7v1wud9tq0.fsf@assigned-by-dhcp.cox.net","threadId":"4333","inReplyTo":"20060529071646.GC6061@spearce.org","subject":"Re: [PATCH] Remove unnecessary ouput from t3600-rm.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-29T07:27:03Z","receivedAt":"2006-05-29T07:27:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shawn Pearce <spearce@spearce.org> writes:\n\n> Moved the output of the setup commits and the test-file rm check to\n> file descriptors 3 and 4 hiding their messages unless -v is given.\n> This makes the test suite look a little cleaner when the rm test-file\n> setup step fails (and was probably expected to fail).\n\nI suspect those bare commands _should_ succeed so make them a\nseparate test step and verify their success return while you are\nat it, and their output would not be shown normally, without\nyour futzing with file descriptors.  Wouldn't that be a lot\ncleaner approach?\n"},{"id":"20876","messageId":"20060529080648.GA6420@spearce.org","threadId":"4333","inReplyTo":"7v1wud9tq0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Remove unnecessary ouput from t3600-rm.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-05-29T08:06:48Z","receivedAt":"2006-05-29T08:06:48Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Shawn Pearce <spearce@spearce.org> writes:\n> \n> > Moved the output of the setup commits and the test-file rm check to\n> > file descriptors 3 and 4 hiding their messages unless -v is given.\n> > This makes the test suite look a little cleaner when the rm test-file\n> > setup step fails (and was probably expected to fail).\n> \n> I suspect those bare commands _should_ succeed so make them a\n> separate test step and verify their success return while you are\n> at it, and their output would not be shown normally, without\n> your futzing with file descriptors.  Wouldn't that be a lot\n> cleaner approach?\n\nYes.  :-)\n\n--> -\nRemove unnecessary output from t3600-rm.\n\nMoved the setup commands into test_expect_success blocks so their\noutput is hidden unless -v is used.  This makes the test suite look\na little cleaner when the rm test-file setup step fails (and was\nexpected to fail for most cases).\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n t/t3600-rm.sh |   42 +++++++++++++++++++++++-------------------\n 1 files changed, 23 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex acaa4d6..201d164 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -8,30 +8,34 @@ test_description='Test of the various op\n . ./test-lib.sh\n \n # Setup some files to be removed, some with funny characters\n-touch -- foo bar baz 'space embedded' -q\n-git-add -- foo bar baz 'space embedded' -q\n-git-commit -m \"add normal files\"\n-test_tabs=y\n-if touch -- 'tab\tembedded' 'newline\n-embedded'\n-then\n-git-add -- 'tab\tembedded' 'newline\n+test_expect_success \\\n+    'Initialize test directory' \\\n+    \"touch -- foo bar baz 'space embedded' -q &&\n+     git-add -- foo bar baz 'space embedded' -q &&\n+     git-commit -m 'add normal files' &&\n+     test_tabs=y &&\n+     if touch -- 'tab\tembedded' 'newline\n embedded'\n-git-commit -m \"add files with tabs and newlines\"\n-else\n-    say 'Your filesystem does not allow tabs in filenames.'\n-    test_tabs=n\n-fi\n+     then\n+     git-add -- 'tab\tembedded' 'newline\n+embedded' &&\n+     git-commit -m 'add files with tabs and newlines'\n+     else\n+         say 'Your filesystem does not allow tabs in filenames.'\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+test_expect_success \\\n+    'Determine rm behavior' \\\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-- \n1.3.3.g45d8\n"}]}