Re: [PATCH 2/2] t: mailmap: add simple name translation test
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:04
Felipe Contreras [off-list ref] writes:
Signed-off-by: Felipe Contreras <redacted> ---
It was clear that we didn't have any test for "blame -e" hence it was no brainer to judge that the patch 1/2 is good without any description. But I am scratching my head, deciphering what this patch adds. It appears to me that the existing tests that map author@example.com from the original "A U Thor" to "Repo Guy" and inspect names and mails in various output already cover this "Wrong with [off-list ref] can be corrected to Mr. Right" case this patch adds. What am I missing? Instead of explaining it to me, can it be explained in the log message? Thanks.
quoted hunk ↗ jump to hunk
t/t4203-mailmap.sh | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index db12265..fc3855a 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh@@ -157,6 +157,9 @@ A U Thor <author@example.com> (1): CTO <cto@company.xx> (1): seventh +Mr. Right <right@company.xx> (1): + eight + Other Author <other@author.xx> (2): third fourth@@ -196,6 +199,11 @@ test_expect_success 'Shortlog output (complex mapping)' ' test_tick && git commit --author "CTO <cto@coompany.xx>" -m seventh && + echo eight >>one && + git add one && + test_tick && + git commit --author "Wrong <right@company.xx>" -m eight && + mkdir -p internal_mailmap && echo "Committed <committer@example.com>" > internal_mailmap/.mailmap && echo "<cto@company.xx> <cto@coompany.xx>" >> internal_mailmap/.mailmap &&@@ -204,6 +212,7 @@ test_expect_success 'Shortlog output (complex mapping)' ' echo "Other Author <other@author.xx> <nick2@company.xx>" >> internal_mailmap/.mailmap && echo "Santa Claus <santa.claus@northpole.xx> <me@company.xx>" >> internal_mailmap/.mailmap && echo "Santa Claus <santa.claus@northpole.xx> <me@company.xx>" >> internal_mailmap/.mailmap && + echo "Mr. Right <right@company.xx>" >> internal_mailmap/.mailmap && git shortlog -e HEAD >actual && test_cmp expect actual@@ -212,6 +221,9 @@ test_expect_success 'Shortlog output (complex mapping)' ' # git log with --pretty format which uses the name and email mailmap placemarkers cat >expect <<\EOF +Author Wrong <right@company.xx> maps to Mr. Right <right@company.xx> +Committer C O Mitter <committer@example.com> maps to Committed <committer@example.com> + Author CTO <cto@coompany.xx> maps to CTO <cto@company.xx> Committer C O Mitter <committer@example.com> maps to Committed <committer@example.com>@@ -248,6 +260,7 @@ OBJID (Other Author DATE 4) four OBJID (Santa Claus DATE 5) five OBJID (Santa Claus DATE 6) six OBJID (CTO DATE 7) seven +OBJID (Mr. Right DATE 8) eight EOF test_expect_success 'Blame output (complex mapping)' ' git blame one >actual &&@@ -264,6 +277,7 @@ OBJID (<other@author.xx> DATE 4) four OBJID (<santa.claus@northpole.xx> DATE 5) five OBJID (<santa.claus@northpole.xx> DATE 6) six OBJID (<cto@company.xx> DATE 7) seven +OBJID (<right@company.xx> DATE 8) eight EOF test_expect_success 'Blame output (complex mapping)' ' git blame -e one >actual &&