git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t4203: fix checks for email address remapping

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 13, 2013, 00:35 UTC
Message-ID
<1373675709-40486-1-git-send-email-sunshine@sunshineco.com>

Two tests in t4203-mailmap.sh set up the mapping <bugs@company.xx> => <bugs@company.xy> in an apparent attempt to check that email address remapping works as expected (in addition to name remapping which is also tested). To test the remapping, git-shortlog is invoked but the invocation lacks the -e option instructing it to show email addresses, hence the tests do not actually prove that address remapping succeeded. Fix this by instructing git-shortlog to output email addresses as well.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---

The very last git-shortlog "complex" test in the script does use -e and checks that email address remapping actually works, so it's not clear that this patch is needed. The <bugs@company.xx> => <bugs@company.xy> remapping done by the two tests touched by this patch, however, is misleading to the reader since it seems to imply that these two tests want to check address remapping as well. Perhaps a better change would be to remove the address remapping from these two tests.

 t/t4203-mailmap.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 842b754..3cf64de 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -102,10 +102,10 @@ test_expect_success 'mailmap.file non-existent' '
 '
 
 cat >expect <<\EOF
-Internal Guy (1):
+Internal Guy <bugs@company.xy> (1):
       second
 
-Repo Guy (1):
+Repo Guy <author@example.com> (1):
       initial
 
 EOF
@@ -114,15 +114,15 @@ test_expect_success 'name entry after email entry' '
 	mkdir -p internal_mailmap &&
 	echo "<bugs@company.xy> <bugs@company.xx>" >internal_mailmap/.mailmap &&
 	echo "Internal Guy <bugs@company.xx>" >>internal_mailmap/.mailmap &&
-	git shortlog HEAD >actual &&
+	git shortlog -e HEAD >actual &&
 	test_cmp expect actual
 '
 
 cat >expect <<\EOF
-Internal Guy (1):
+Internal Guy <bugs@company.xy> (1):
       second
 
-Repo Guy (1):
+Repo Guy <author@example.com> (1):
       initial
 
 EOF
@@ -131,7 +131,7 @@ test_expect_success 'name entry after email entry, case-insensitive' '
 	mkdir -p internal_mailmap &&
 	echo "<bugs@company.xy> <bugs@company.xx>" >internal_mailmap/.mailmap &&
 	echo "Internal Guy <BUGS@Company.xx>" >>internal_mailmap/.mailmap &&
-	git shortlog HEAD >actual &&
+	git shortlog -e HEAD >actual &&
 	test_cmp expect actual
 '
 
-- 
1.8.3.2.804.g0da7a53
Next: Stefan Beller
Message 1 of 3 in “t4203: fix checks for email address remapping”
  1. t4203: fix checks for email address remappingEric Sunshine, Jul 13, 2013
  2. Stefan BellerJul 13, 2013
  3. Eric SunshineJul 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.