Merge pull request #937 from tfendin/dedup_email_case_insensitive

Compare email adresses case insensitive in --dedup-by-email
This commit is contained in:
罗泽轩 2021-08-17 08:59:46 +08:00 committed by GitHub
commit 4de7b34c9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,17 +90,18 @@ file_count() {
dedup_by_email() {
# in:
# 27 luo zexuan <luozexuan@xxx.com>
# 27 luo zexuan <LuoZexuan@xxx.com>
# 7 罗泽轩 <luozexuan@xxx.com>
# out:
# 34 luo zexuan
LC_ALL=C awk '
{
sum += $1
if ($NF in emails) {
emails[$NF] += $1
last_field = tolower($NF)
if (last_field in emails) {
emails[last_field] += $1
} else {
email = $NF
email = last_field
emails[email] = $1
# set commits/email to empty
$1=$NF=""