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

[PATCH v2 7/7] test: Add test for --use-mailmap option

From
Antoine Pelisse <apelisse@gmail.com>
Date
Dec 15, 2012, 18:05 UTC
Message-ID
<1355594754-27589-8-git-send-email-apelisse@gmail.com>
In-Reply-To
<1355594754-27589-1-git-send-email-apelisse@gmail.com>

The new option '--use-mailmap' can be used to make sure that mailmap file is used to convert name when running log commands.

The test is simple and checks that the Author line is correctly replaced when running log.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
---
 t/t4203-mailmap.sh |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 1f182f6..db043dc 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -239,6 +239,20 @@ test_expect_success 'Log output (complex mapping)' '
 	test_cmp expect actual
 '
 
+cat >expect <<\EOF
+Author: CTO <cto@company.xx>
+Author: Santa Claus <santa.claus@northpole.xx>
+Author: Santa Claus <santa.claus@northpole.xx>
+Author: Other Author <other@author.xx>
+Author: Other Author <other@author.xx>
+Author: Some Dude <some@dude.xx>
+Author: A U Thor <author@example.com>
+EOF
+test_expect_success 'Log output with --use-mailmap' '
+	git log --use-mailmap | grep Author >actual &&
+	test_cmp expect actual
+'
+
 # git blame
 cat >expect <<\EOF
 ^OBJI (A U Thor     DATE 1) one
-- 
1.7.9.5
Previous: Antoine PelisseNext: Junio C Hamano
Message 8 of 9 in “Allow git log to use mailmap file”
  1. 0/7 Allow git log to use mailmap fileAntoine Pelisse, Dec 15, 2012
  2. 1/7 Use split_ident_line to parse author and committerAntoine Pelisse, Dec 15, 2012
  3. 2/7 mailmap: Remove buffer length limit in map_userAntoine Pelisse, Dec 15, 2012
  4. 3/7 mailmap: Simplify map_user() interfaceAntoine Pelisse, Dec 15, 2012
  5. 4/7 mailmap: Add mailmap structure to rev_info and ppAntoine Pelisse, Dec 15, 2012
  6. 5/7 pretty: Use mailmap to display username and emailAntoine Pelisse, Dec 15, 2012
  7. 6/7 log: Add --use-mailmap optionAntoine Pelisse, Dec 15, 2012
  8. 7/7 test: Add test for --use-mailmap optionAntoine Pelisse, Dec 15, 2012
  9. Junio C HamanoDec 15, 2012

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.