From: Jonathan Nieder <jrnieder@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: [PATCH 1/2] test: mailmap can change author name without changing email
Date: Tue, 14 Feb 2012 14:35:19 -0600 [thread overview]
Message-ID: <20120214203519.GC13210@burratino> (raw)
In-Reply-To: <20120214203431.GB13210@burratino>
From: Felipe Contreras <felipe.contreras@gmail.com>
A mailmap entry of the format 'A U Thor <email@example.com>' has two
effects: (1) 'A U Thor' becomes the canonical author name for commits
with author address 'email@example.com', and (2) 'email@example.com'
becomes the canonical author email for commits with author name 'A U
Thor'.
We already have tests for the effect (1) in the committer name, but
not in the author name, so the tests do not cover the shortlog and
blame codepaths as they should. Fix that.
[jn: simplified by reusing Committer mailmap entry, clarified
description]
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
t/t4203-mailmap.sh | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 1f182f61..45526395 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
+Committed <committer@example.com> (1):
+ eighth
+
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 "C O Mitter <committer@example.com>" -m eighth &&
+
mkdir -p internal_mailmap &&
echo "Committed <committer@example.com>" > internal_mailmap/.mailmap &&
echo "<cto@company.xx> <cto@coompany.xx>" >> internal_mailmap/.mailmap &&
@@ -212,6 +220,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 C O Mitter <committer@example.com> maps to Committed <committer@example.com>
+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 +259,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 (Committed DATE 8) eight
EOF
test_expect_success 'Blame output (complex mapping)' '
git blame one >actual &&
--
1.7.9
next prev parent reply other threads:[~2012-02-14 20:35 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-14 16:11 [PATCH 0/2] t: add blame -e tests for mailmap Felipe Contreras
2012-02-14 16:11 ` [PATCH 1/2] t: mailmap: add 'git blame -e' tests Felipe Contreras
2012-02-14 16:11 ` [PATCH 2/2] t: mailmap: add simple name translation test Felipe Contreras
2012-02-14 20:10 ` Junio C Hamano
2012-02-14 20:28 ` Felipe Contreras
2012-02-14 20:34 ` [PATCH v3 0/2] test: tests for the "double > from mailmap" bug Jonathan Nieder
2012-02-14 20:35 ` Jonathan Nieder [this message]
2012-02-14 21:35 ` [PATCH 1/2] test: mailmap can change author name without changing email Felipe Contreras
2012-02-14 21:50 ` Jonathan Nieder
2012-02-14 22:48 ` Felipe Contreras
2012-02-14 20:36 ` [PATCH 2/2] test: check that "git blame -e" uses mailmap correctly Jonathan Nieder
2012-02-14 21:41 ` Felipe Contreras
2012-02-14 21:59 ` Jonathan Nieder
2012-02-14 22:56 ` Felipe Contreras
2012-02-14 21:06 ` [PATCH v3 0/2] test: tests for the "double > from mailmap" bug Felipe Contreras
2012-02-14 21:15 ` Jonathan Nieder
2012-02-14 22:09 ` Felipe Contreras
2012-02-14 22:21 ` Jonathan Nieder
2012-02-14 22:36 ` Felipe Contreras
2012-02-14 21:14 ` Jeff King
2012-02-14 21:27 ` Jonathan Nieder
2012-02-14 21:52 ` Felipe Contreras
2012-02-14 22:07 ` Jeff King
2012-02-14 22:22 ` Felipe Contreras
2012-02-14 22:35 ` Jeff King
2012-02-14 22:18 ` Junio C Hamano
2012-02-14 22:34 ` Felipe Contreras
2012-02-14 22:49 ` Junio C Hamano
2012-02-14 23:14 ` Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120214203519.GC13210@burratino \
--to=jrnieder@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).