]> git.ipfire.org Git - thirdparty/git.git/commit
ident: don't consider '.' a crud
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 2 Aug 2023 16:49:32 +0000 (09:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Aug 2023 16:50:52 +0000 (09:50 -0700)
commit1c04cb0744d2acdcaebc77b0e78c47efbba67fd5
tree9e2954c21b9663e16dde5fc345047da3e285fc15
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3
ident: don't consider '.' a crud

When we process a user's name (as in user.name), we strip all
leading and trailing crud from it.  Right now, we consider a dot
a crud character, and strip it off.

However, this is unsuitable for many personal names because humans
frequently have abbreviated suffixes, such as "Jr." or "Sr." at the end
of their names, and this corrupts them.  Some other users may wish to
use an abbreviated name or initial, which will pose a problem especially
in cultures that write the family name first, followed by the personal
name.

Since the current approach causes lots of practical problems, let's
avoid it by no longer considering a dot to be crud.

Note that "." in the name forces the entire name to be quoted to
please mailers, but stripping "." only at the beginning and the end
does not help a name with "." in the middle (like "brian m. carlson")
so this change will not make it much worse.  A name like "Given
Family, Jr." that did not have to be quoted now would need to be, in
order to be placed on the e-mail headers, though.

This is based on a weather-balloon patch by Jeff King sent in Aug 2021
https://lore.kernel.org/git/YSKm8Q8nyTavQaox@coredump.intra.peff.net/

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ident.c
t/t4203-mailmap.sh
t/t7518-ident-corner-cases.sh