Skip to content

Commit 4de7b34

Browse files
authored
Merge pull request #937 from tfendin/dedup_email_case_insensitive
Compare email adresses case insensitive in --dedup-by-email
2 parents 0edcf8b + 5feb0db commit 4de7b34

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bin/git-summary

+5-4
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,18 @@ file_count() {
9090

9191
dedup_by_email() {
9292
# in:
93-
# 27 luo zexuan <luozexuan@xxx.com>
93+
# 27 luo zexuan <LuoZexuan@xxx.com>
9494
# 7 罗泽轩 <luozexuan@xxx.com>
9595
# out:
9696
# 34 luo zexuan
9797
LC_ALL=C awk '
9898
{
9999
sum += $1
100-
if ($NF in emails) {
101-
emails[$NF] += $1
100+
last_field = tolower($NF)
101+
if (last_field in emails) {
102+
emails[last_field] += $1
102103
} else {
103-
email = $NF
104+
email = last_field
104105
emails[email] = $1
105106
# set commits/email to empty
106107
$1=$NF=""

0 commit comments

Comments
 (0)