On Tue, Feb 14, 2012 at 10:35 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote: > From: Felipe Contreras <felipe.contreras@xxxxxxxxx> > 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@xxxxxxxxxxx' > 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 <author@xxxxxxxxxxx> (1): CTO <cto@xxxxxxxxxx> (1): seventh -Committed <committer@xxxxxxxxxxx> (1): +Committed <committer@xxxxxxxxxxx> (2): eighth + nine Other Author <other@xxxxxxxxx> (2): third @@ -204,6 +205,11 @@ test_expect_success 'Shortlog output (complex mapping)' ' test_tick && git commit --author "C O Mitter <committer@xxxxxxxxxxx>" -m eighth && + echo nine >>one && + git add one && + test_tick && + git commit --author "Committed <bad@xxxxxxxxxxx>" -m nine && + mkdir -p internal_mailmap && echo "Committed <committer@xxxxxxxxxxx>" > internal_mailmap/.mailmap && echo "<cto@xxxxxxxxxx> <cto@xxxxxxxxxxx>" >> 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 <committer@xxxxxxxxxxx> maps to Committed <committer@xxxxxxxxxxx> +Committer C O Mitter <committer@xxxxxxxxxxx> maps to Committed <committer@xxxxxxxxxxx> + Author C O Mitter <committer@xxxxxxxxxxx> maps to Committed <committer@xxxxxxxxxxx> Committer C O Mitter <committer@xxxxxxxxxxx> maps to Committed <committer@xxxxxxxxxxx> @@ -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 <felipe.contreras@xxxxxxxxx> 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 <committer@xxxxxxxxxxx>" 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 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html