{"thread":{"id":"34425","subject":"[PATCH] t4203: fix checks for email address remapping","startedAt":"2013-07-13T00:35:09Z","lastAt":"2013-07-15T07:00:58Z","messageCount":3,"participants":["Eric Sunshine","Stefan Beller"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"223233","messageId":"1373675709-40486-1-git-send-email-sunshine@sunshineco.com","threadId":"34425","inReplyTo":null,"subject":"[PATCH] t4203: fix checks for email address remapping","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-13T00:35:09Z","receivedAt":"2013-07-13T00:35:09Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"Two tests in t4203-mailmap.sh set up the mapping <bugs@company.xx> =>\n<bugs@company.xy> in an apparent attempt to check that email address\nremapping works as expected (in addition to name remapping which is also\ntested).  To test the remapping, git-shortlog is invoked but the\ninvocation lacks the -e option instructing it to show email addresses,\nhence the tests do not actually prove that address remapping succeeded.\nFix this by instructing git-shortlog to output email addresses as well.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n\nThe very last git-shortlog \"complex\" test in the script does use -e and\nchecks that email address remapping actually works, so it's not clear\nthat this patch is needed. The <bugs@company.xx> => <bugs@company.xy>\nremapping done by the two tests touched by this patch, however, is\nmisleading to the reader since it seems to imply that these two tests\nwant to check address remapping as well. Perhaps a better change would\nbe to remove the address remapping from these two tests.\n\n\n t/t4203-mailmap.sh | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 842b754..3cf64de 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -102,10 +102,10 @@ test_expect_success 'mailmap.file non-existent' '\n '\n \n cat >expect <<\\EOF\n-Internal Guy (1):\n+Internal Guy <bugs@company.xy> (1):\n       second\n \n-Repo Guy (1):\n+Repo Guy <author@example.com> (1):\n       initial\n \n EOF\n@@ -114,15 +114,15 @@ test_expect_success 'name entry after email entry' '\n \tmkdir -p internal_mailmap &&\n \techo \"<bugs@company.xy> <bugs@company.xx>\" >internal_mailmap/.mailmap &&\n \techo \"Internal Guy <bugs@company.xx>\" >>internal_mailmap/.mailmap &&\n-\tgit shortlog HEAD >actual &&\n+\tgit shortlog -e HEAD >actual &&\n \ttest_cmp expect actual\n '\n \n cat >expect <<\\EOF\n-Internal Guy (1):\n+Internal Guy <bugs@company.xy> (1):\n       second\n \n-Repo Guy (1):\n+Repo Guy <author@example.com> (1):\n       initial\n \n EOF\n@@ -131,7 +131,7 @@ test_expect_success 'name entry after email entry, case-insensitive' '\n \tmkdir -p internal_mailmap &&\n \techo \"<bugs@company.xy> <bugs@company.xx>\" >internal_mailmap/.mailmap &&\n \techo \"Internal Guy <BUGS@Company.xx>\" >>internal_mailmap/.mailmap &&\n-\tgit shortlog HEAD >actual &&\n+\tgit shortlog -e HEAD >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n1.8.3.2.804.g0da7a53\n"},{"id":"223240","messageId":"51E0F3CC.3040304@googlemail.com","threadId":"34425","inReplyTo":"1373675709-40486-1-git-send-email-sunshine@sunshineco.com","subject":"Re: [PATCH] t4203: fix checks for email address remapping","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-07-13T06:29:32Z","receivedAt":"2013-07-13T06:29:32Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On 07/13/2013 02:35 AM, Eric Sunshine wrote:\n> Two tests in t4203-mailmap.sh set up the mapping <bugs@company.xx> =>\n> <bugs@company.xy> in an apparent attempt to check that email address\n> remapping works as expected (in addition to name remapping which is also\n> tested).  To test the remapping, git-shortlog is invoked but the\n> invocation lacks the -e option instructing it to show email addresses,\n> hence the tests do not actually prove that address remapping succeeded.\n> Fix this by instructing git-shortlog to output email addresses as well.\n> \n> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>\n> ---\n> \n> The very last git-shortlog \"complex\" test in the script does use -e and\n> checks that email address remapping actually works, so it's not clear\n> that this patch is needed. The <bugs@company.xx> => <bugs@company.xy>\n> remapping done by the two tests touched by this patch, however, is\n> misleading to the reader since it seems to imply that these two tests\n> want to check address remapping as well. Perhaps a better change would\n> be to remove the address remapping from these two tests.\n> \n> \n>  t/t4203-mailmap.sh | 12 ++++++------\n>  1 file changed, 6 insertions(+), 6 deletions(-)\n> \n> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\n> index 842b754..3cf64de 100755\n> --- a/t/t4203-mailmap.sh\n> +++ b/t/t4203-mailmap.sh\n> @@ -102,10 +102,10 @@ test_expect_success 'mailmap.file non-existent' '\n>  '\n>  \n>  cat >expect <<\\EOF\n> -Internal Guy (1):\n> +Internal Guy <bugs@company.xy> (1):\n>        second\n>  \n> -Repo Guy (1):\n> +Repo Guy <author@example.com> (1):\n>        initial\n>  \n>  EOF\n> @@ -114,15 +114,15 @@ test_expect_success 'name entry after email entry' '\n>  \tmkdir -p internal_mailmap &&\n>  \techo \"<bugs@company.xy> <bugs@company.xx>\" >internal_mailmap/.mailmap &&\n>  \techo \"Internal Guy <bugs@company.xx>\" >>internal_mailmap/.mailmap &&\n> -\tgit shortlog HEAD >actual &&\n> +\tgit shortlog -e HEAD >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n>  cat >expect <<\\EOF\n> -Internal Guy (1):\n> +Internal Guy <bugs@company.xy> (1):\n>        second\n>  \n> -Repo Guy (1):\n> +Repo Guy <author@example.com> (1):\n>        initial\n>  \n>  EOF\n> @@ -131,7 +131,7 @@ test_expect_success 'name entry after email entry, case-insensitive' '\n>  \tmkdir -p internal_mailmap &&\n>  \techo \"<bugs@company.xy> <bugs@company.xx>\" >internal_mailmap/.mailmap &&\n>  \techo \"Internal Guy <BUGS@Company.xx>\" >>internal_mailmap/.mailmap &&+\n\nSo here it is capitalized email address (BUGS@), but at the expect file\nit's still lower cased. I think this is a bug.\nJunio was trying to fix it in 543f99173c2d2f648d8f846e24875150f7de03d3\n(origin/jc/mailmap-case-insensitivity)\nSo I think we need another yet test case there:\ncommited:\n    Internal Guy <BUGS@Company.xx>\n    Internal Guy <bugs@company.xy>\n\nHaving just one entry in the mailmap\n    Internal Guy <BUGS@Company.xx> <bugs@Company.xy>\n\nshould still work with the \"shortlog -e\"\n\n> -\tgit shortlog HEAD >actual &&\n> +\tgit shortlog -e HEAD >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> \n"},{"id":"223395","messageId":"CAPig+cT6zY9F1AEyJx3bw8RYgxPWBuGqyUQm=t8G6ORs4mSs6Q@mail.gmail.com","threadId":"34425","inReplyTo":"51E0F3CC.3040304@googlemail.com","subject":"Re: [PATCH] t4203: fix checks for email address remapping","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-07-15T07:00:58Z","receivedAt":"2013-07-15T07:00:58Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Jul 13, 2013 at 2:29 AM, Stefan Beller\n<stefanbeller@googlemail.com> wrote:\n> On 07/13/2013 02:35 AM, Eric Sunshine wrote:\n>> Two tests in t4203-mailmap.sh set up the mapping <bugs@company.xx> =>\n>> <bugs@company.xy> in an apparent attempt to check that email address\n>> remapping works as expected (in addition to name remapping which is also\n>> tested).  To test the remapping, git-shortlog is invoked but the\n>> invocation lacks the -e option instructing it to show email addresses,\n>> hence the tests do not actually prove that address remapping succeeded.\n>> Fix this by instructing git-shortlog to output email addresses as well.\n>>\n>> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>\n>> ---\n>>\n>> The very last git-shortlog \"complex\" test in the script does use -e and\n>> checks that email address remapping actually works, so it's not clear\n>> that this patch is needed. The <bugs@company.xx> => <bugs@company.xy>\n>> remapping done by the two tests touched by this patch, however, is\n>> misleading to the reader since it seems to imply that these two tests\n>> want to check address remapping as well. Perhaps a better change would\n>> be to remove the address remapping from these two tests.\n>>\n>>  cat >expect <<\\EOF\n>> -Internal Guy (1):\n>> +Internal Guy <bugs@company.xy> (1):\n>>        second\n>>\n>> -Repo Guy (1):\n>> +Repo Guy <author@example.com> (1):\n>>        initial\n>>\n>>  EOF\n>> @@ -131,7 +131,7 @@ test_expect_success 'name entry after email entry, case-insensitive' '\n>>       mkdir -p internal_mailmap &&\n>>       echo \"<bugs@company.xy> <bugs@company.xx>\" >internal_mailmap/.mailmap &&\n>>       echo \"Internal Guy <BUGS@Company.xx>\" >>internal_mailmap/.mailmap &&+\n>\n> So here it is capitalized email address (BUGS@), but at the expect file\n> it's still lower cased. I think this is a bug.\n> Junio was trying to fix it in 543f99173c2d2f648d8f846e24875150f7de03d3\n> (origin/jc/mailmap-case-insensitivity)\n\nWith the re-roll of Junio's series which I just sent out [1], this\ncase-preserving problem is tested (and fixed), and email address\nremapping is tested in general, so I think this submission should be\nretired.\n\n(It might still be worthwhile, as mentioned in the patch commentary,\nto drop the confusing lines altogether from those two tests, but\nthat's an issue for another day.)\n\n[1]: http://thread.gmane.org/gmane.comp.version-control.git/230425/\n\n> So I think we need another yet test case there:\n> commited:\n>     Internal Guy <BUGS@Company.xx>\n>     Internal Guy <bugs@company.xy>\n>\n> Having just one entry in the mailmap\n>     Internal Guy <BUGS@Company.xx> <bugs@Company.xy>\n>\n> should still work with the \"shortlog -e\"\n>\n>> -     git shortlog HEAD >actual &&\n>> +     git shortlog -e HEAD >actual &&\n>>       test_cmp expect actual\n>>  '\n"}]}