{"thread":{"id":"46787","subject":"[PATCH] t4014: strengthen search patterns","startedAt":"2017-09-19T12:47:04Z","lastAt":"2017-09-20T02:50:14Z","messageCount":2,"participants":["Kaartic Sivaraam","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"328383","messageId":"0102015e9a2d5d25-e34b7c98-1662-4cfe-9eb8-50dc56c36240-000000@eu-west-1.amazonses.com","threadId":"46787","inReplyTo":null,"subject":"[PATCH] t4014: strengthen search patterns","fromName":"Kaartic Sivaraam","fromEmail":"kaarticsivaraam91196@gmail.com","sentAt":"2017-09-19T12:46:57Z","receivedAt":"2017-09-19T12:47:04Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"The regex patterns for some failing test cases were a bit loose\ngiving way for a few incorrect outputs being accepted as correct\noutputs.\n\nTo avoid such incorrect outputs from being flagged as correct ones\nuse fixed string matches when possible and strengthen regex when\nit's not.\n\nSigned-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n---\n t/t4014-format-patch.sh | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 482112ca339f0..7dff7996c9e1f 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -163,7 +163,7 @@ test_expect_failure 'additional command line cc (rfc822)' '\n \tgit config --replace-all format.headers \"Cc: R E Cipient <rcipient@example.com>\" &&\n \tgit format-patch --cc=\"S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch5 &&\n \tgrep \"^Cc: R E Cipient <rcipient@example.com>,\\$\" patch5 &&\n-\tgrep \"^ *\\\"S. E. Cipient\\\" <scipient@example.com>\\$\" patch5\n+\tgrep \"^ *\\\"S\\. E\\. Cipient\\\" <scipient@example\\.com>\\$\" patch5\n '\n \n test_expect_success 'command line headers' '\n@@ -191,13 +191,13 @@ test_expect_success 'command line To: header (ascii)' '\n test_expect_failure 'command line To: header (rfc822)' '\n \n \tgit format-patch --to=\"R. E. Cipient <rcipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch8 &&\n-\tgrep \"^To: \\\"R. E. Cipient\\\" <rcipient@example.com>\\$\" patch8\n+\tgrep -F \"To: \\\"R. E. Cipient\\\" <rcipient@example.com>\" patch8\n '\n \n test_expect_failure 'command line To: header (rfc2047)' '\n \n \tgit format-patch --to=\"R Ä Cipient <rcipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch8 &&\n-\tgrep \"^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\\$\" patch8\n+\tgrep \"^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example\\.com>\\$\" patch8\n '\n \n test_expect_success 'configuration To: header (ascii)' '\n@@ -211,14 +211,14 @@ test_expect_failure 'configuration To: header (rfc822)' '\n \n \tgit config format.to \"R. E. Cipient <rcipient@example.com>\" &&\n \tgit format-patch --stdout master..side | sed -e \"/^\\$/q\" >patch9 &&\n-\tgrep \"^To: \\\"R. E. Cipient\\\" <rcipient@example.com>\\$\" patch9\n+\tgrep -F \"To: \\\"R. E. Cipient\\\" <rcipient@example.com>\" patch9\n '\n \n test_expect_failure 'configuration To: header (rfc2047)' '\n \n \tgit config format.to \"R Ä Cipient <rcipient@example.com>\" &&\n \tgit format-patch --stdout master..side | sed -e \"/^\\$/q\" >patch9 &&\n-\tgrep \"^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\\$\" patch9\n+\tgrep \"^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example\\.com>\\$\" patch9\n '\n \n # check_patch <patch>: Verify that <patch> looks like a half-sane\n\n--\nhttps://github.com/git/git/pull/406\n"},{"id":"328441","messageId":"xmqqingeozhc.fsf@gitster.mtv.corp.google.com","threadId":"46787","inReplyTo":"0102015e9a2d5d25-e34b7c98-1662-4cfe-9eb8-50dc56c36240-000000@eu-west-1.amazonses.com","subject":"Re: [PATCH] t4014: strengthen search patterns","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-09-20T02:50:07Z","receivedAt":"2017-09-20T02:50:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:\n\n> The regex patterns for some failing test cases were a bit loose\n> giving way for a few incorrect outputs being accepted as correct\n> outputs.\n\nIf these were part of scripted Porcelain that needs to take any\nend-user input, then having '.' that are meant to match only a dot\nis a bug, but I personally do not think it is worth the patch noise\nto quote them, when we _know_ (after all, we are in control of the\ndata we use for these tests) there is no other lines that would\nmatch these patterns.\n\n\n\n> To avoid such incorrect outputs from being flagged as correct ones\n> use fixed string matches when possible and strengthen regex when\n> it's not.\n>\n> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>\n> ---\n>  t/t4014-format-patch.sh | 10 +++++-----\n>  1 file changed, 5 insertions(+), 5 deletions(-)\n>\n> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n> index 482112ca339f0..7dff7996c9e1f 100755\n> --- a/t/t4014-format-patch.sh\n> +++ b/t/t4014-format-patch.sh\n> @@ -163,7 +163,7 @@ test_expect_failure 'additional command line cc (rfc822)' '\n>  \tgit config --replace-all format.headers \"Cc: R E Cipient <rcipient@example.com>\" &&\n>  \tgit format-patch --cc=\"S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch5 &&\n>  \tgrep \"^Cc: R E Cipient <rcipient@example.com>,\\$\" patch5 &&\n> -\tgrep \"^ *\\\"S. E. Cipient\\\" <scipient@example.com>\\$\" patch5\n> +\tgrep \"^ *\\\"S\\. E\\. Cipient\\\" <scipient@example\\.com>\\$\" patch5\n>  '\n>  \n>  test_expect_success 'command line headers' '\n> @@ -191,13 +191,13 @@ test_expect_success 'command line To: header (ascii)' '\n>  test_expect_failure 'command line To: header (rfc822)' '\n>  \n>  \tgit format-patch --to=\"R. E. Cipient <rcipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch8 &&\n> -\tgrep \"^To: \\\"R. E. Cipient\\\" <rcipient@example.com>\\$\" patch8\n> +\tgrep -F \"To: \\\"R. E. Cipient\\\" <rcipient@example.com>\" patch8\n>  '\n>  \n>  test_expect_failure 'command line To: header (rfc2047)' '\n>  \n>  \tgit format-patch --to=\"R Ä Cipient <rcipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch8 &&\n> -\tgrep \"^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\\$\" patch8\n> +\tgrep \"^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example\\.com>\\$\" patch8\n>  '\n>  \n>  test_expect_success 'configuration To: header (ascii)' '\n> @@ -211,14 +211,14 @@ test_expect_failure 'configuration To: header (rfc822)' '\n>  \n>  \tgit config format.to \"R. E. Cipient <rcipient@example.com>\" &&\n>  \tgit format-patch --stdout master..side | sed -e \"/^\\$/q\" >patch9 &&\n> -\tgrep \"^To: \\\"R. E. Cipient\\\" <rcipient@example.com>\\$\" patch9\n> +\tgrep -F \"To: \\\"R. E. Cipient\\\" <rcipient@example.com>\" patch9\n>  '\n>  \n>  test_expect_failure 'configuration To: header (rfc2047)' '\n>  \n>  \tgit config format.to \"R Ä Cipient <rcipient@example.com>\" &&\n>  \tgit format-patch --stdout master..side | sed -e \"/^\\$/q\" >patch9 &&\n> -\tgrep \"^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example.com>\\$\" patch9\n> +\tgrep \"^To: =?UTF-8?q?R=20=C3=84=20Cipient?= <rcipient@example\\.com>\\$\" patch9\n>  '\n>  \n>  # check_patch <patch>: Verify that <patch> looks like a half-sane\n>\n> --\n> https://github.com/git/git/pull/406\n"}]}