diff mbox series

[21/22] mailmap doc + tests: document and test for case-insensitivity

Message ID 20210112201806.13284-22-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series shortlog: remove unused(?) "repo-abbrev" feature | expand

Commit Message

Ævar Arnfjörð Bjarmason Jan. 12, 2021, 8:18 p.m. UTC
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>
---
 Documentation/gitmailmap.txt |  5 +++++
 t/t4203-mailmap.sh           | 14 ++++++++++++++
 2 files changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/Documentation/gitmailmap.txt b/Documentation/gitmailmap.txt
index 55dfebd1b1..7f1089786d 100644
--- a/Documentation/gitmailmap.txt
+++ b/Documentation/gitmailmap.txt
@@ -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
 --------
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index f19736fef1..89cb300f28 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -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
 '