]> git.ipfire.org Git - thirdparty/git.git/commitdiff
mailmap doc + tests: document and test for case-insensitivity
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 12 Jan 2021 20:18:05 +0000 (21:18 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Jan 2021 22:04:42 +0000 (14:04 -0800)
Add documentation and more tests for case-insensitivity. The existing
test only matched on the E-Mail part, but as shown here we also match
the name with strcasecmp().

This behavior was last discussed on the mailing list in the thread
starting at [1]. It seems we're keeping it like this, so let's
document it.

1. https://lore.kernel.org/git/87czykvg19.fsf@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitmailmap.txt
t/t4203-mailmap.sh

index 55dfebd1b180dbc27bce5aea38a97e274adb480f..7f1089786d6bb509de0cade87f42697f6bcdc19b 100644 (file)
@@ -49,6 +49,11 @@ commit matching the specified commit email address, and:
 which allows mailmap to replace both the name and the email of a
 commit matching both the specified commit name and email address.
 
+Both E-Mails and names are matched case-insensitively. For example
+this would also match the 'Commit Name <commit@email.xx>' above:
+--
+Proper Name <proper@email.xx> CoMmIt NaMe <CoMmIt@EmAiL.xX>
+--
 
 EXAMPLES
 --------
index f19736fef1c8226bc234d262b5ba0fec8b9a2a6e..89cb300f28262810fb7c6944fdc61d82b91658c4 100755 (executable)
@@ -220,7 +220,21 @@ test_expect_success 'name entry after email entry, case-insensitive' '
              initial
 
        EOF
+       git shortlog HEAD >actual &&
+       test_cmp expect actual &&
+
+       cat >internal.map <<-\EOF &&
+       NiCk <BuGs@CoMpAnY.Xy> NICK1 <BUGS@COMPANY.XX>
+       EOF
+
+       cat >expect <<-\EOF &&
+       NiCk (1):
+             second
+
+       Repo Guy (1):
+             initial
 
+       EOF
        git shortlog HEAD >actual &&
        test_cmp expect actual
 '