From: Felipe Contreras Date: Tue, 14 Feb 2012 21:35:33 GMT Subject: Re: [PATCH 1/2] test: mailmap can change author name without changing email Message-ID: In-Reply-To: <20120214203519.GC13210@burratino> On Tue, Feb 14, 2012 at 10:35 PM, Jonathan Nieder wrote: > From: Felipe Contreras > test: mailmap can change author name without changing email That doesn't say anything to me, which is weird if I supposedly wrote this patch. What is the *purpose* of this? At least 'add simple name translation test' is clear about the purpose, albeit not clear enough as Junio pointed out. > (2) 'email@example.com' > becomes the canonical author email for commits with author name 'A U > Thor'. That's not true. I initially thought that was the case, and I think it might be useful to have that, but it's not the case now, and your patch doesn't test this. > 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. In order to test that you would need additional changes, something along the lines of: --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -157,8 +157,9 @@ A U Thor (1): CTO (1): seventh -Committed (1): +Committed (2): eighth + nine Other Author (2): third @@ -204,6 +205,11 @@ test_expect_success 'Shortlog output (complex mapping)' ' test_tick && git commit --author "C O Mitter " -m eighth && + echo nine >>one && + git add one && + test_tick && + git commit --author "Committed " -m nine && + mkdir -p internal_mailmap && echo "Committed " > internal_mailmap/.mailmap && echo " " >> internal_mailmap/.mailmap && @@ -220,6 +226,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 Committed maps to Committed +Committer C O Mitter maps to Committed + Author C O Mitter maps to Committed Committer C O Mitter maps to Committed @@ -260,6 +269,7 @@ OBJID (Santa Claus DATE 5) five OBJID (Santa Claus DATE 6) six OBJID (CTO DATE 7) seven OBJID (Committed DATE 8) eight +OBJID (Committed DATE 9) nine EOF test_expect_success 'Blame output (complex mapping)' ' git blame one >actual && But that of course fails. > Signed-off-by: Felipe Contreras I most definitely did not sign this off, and I didn't add any of these lines, nor wrote anything about this commit message. It might be possible to simplify my patch "t: mailmap: add simple name translation test" using the already existing "Committed " mapping, but that most likely is going to remove only one line, and would make the code less clear about what that translation is trying to test. Cheers. -- Felipe Contreras