{"thread":{"id":"52088","subject":"[PATCH] t7419: change test_must_fail to ! for grep","startedAt":"2019-10-22T09:57:07Z","lastAt":"2019-10-23T02:18:21Z","messageCount":2,"participants":["Denton Liu","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"384579","messageId":"6b788f92d2ef6f6cdaf6ea9f2bbe448ce19b2f58.1571737787.git.liu.denton@gmail.com","threadId":"52088","inReplyTo":null,"subject":"[PATCH] t7419: change test_must_fail to ! for grep","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-22T09:57:01Z","receivedAt":"2019-10-22T09:57:07Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"According to t/README, test_must_fail() should only be used to test for\nfailure in Git commands. Replace the invocations of\n`test_must_fail grep` with `! grep`.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n*sigh* Here's another cleanup patch for 'dl/submodule-set-branch'. It's\ninspired by Eric Sunshine's comments on the t5520 patchset from earlier.\nIt's definitely not urgent, though, and can wait for v2.25.0.\n\n t/t7419-submodule-set-branch.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t7419-submodule-set-branch.sh b/t/t7419-submodule-set-branch.sh\nindex c4b370ea85..fd25f786a3 100755\n--- a/t/t7419-submodule-set-branch.sh\n+++ b/t/t7419-submodule-set-branch.sh\n@@ -34,7 +34,7 @@ test_expect_success 'submodule config cache setup' '\n \n test_expect_success 'ensure submodule branch is unset' '\n \t(cd super &&\n-\t\ttest_must_fail grep branch .gitmodules\n+\t\t! grep branch .gitmodules\n \t)\n '\n \n@@ -54,7 +54,7 @@ test_expect_success 'test submodule set-branch --branch' '\n test_expect_success 'test submodule set-branch --default' '\n \t(cd super &&\n \t\tgit submodule set-branch --default submodule &&\n-\t\ttest_must_fail grep branch .gitmodules &&\n+\t\t! grep branch .gitmodules &&\n \t\tgit submodule update --remote &&\n \t\tcat <<-\\EOF >expect &&\n \t\ta\n@@ -80,7 +80,7 @@ test_expect_success 'test submodule set-branch -b' '\n test_expect_success 'test submodule set-branch -d' '\n \t(cd super &&\n \t\tgit submodule set-branch -d submodule &&\n-\t\ttest_must_fail grep branch .gitmodules &&\n+\t\t! grep branch .gitmodules &&\n \t\tgit submodule update --remote &&\n \t\tcat <<-\\EOF >expect &&\n \t\ta\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384664","messageId":"xmqq4l00jjbu.fsf@gitster-ct.c.googlers.com","threadId":"52088","inReplyTo":"6b788f92d2ef6f6cdaf6ea9f2bbe448ce19b2f58.1571737787.git.liu.denton@gmail.com","subject":"Re: [PATCH] t7419: change test_must_fail to ! for grep","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-23T02:18:13Z","receivedAt":"2019-10-23T02:18:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Denton Liu <liu.denton@gmail.com> writes:\n\n> According to t/README, test_must_fail() should only be used to test for\n> failure in Git commands. Replace the invocations of\n> `test_must_fail grep` with `! grep`.\n>\n> Signed-off-by: Denton Liu <liu.denton@gmail.com>\n> ---\n> *sigh* Here's another cleanup patch for 'dl/submodule-set-branch'. It's\n> inspired by Eric Sunshine's comments on the t5520 patchset from earlier.\n> It's definitely not urgent, though, and can wait for v2.25.0.\n\nTrue, but they are trivially correct and removes the risk of\ninexperienced developers copying and pasting this bad pattern to\nother tests that was added during this cycle, so I think it is a\ngood idea to take it now.\n\nThanks for being extra careful.\n"}]}