Skip to content

Commit 7ff788c

Browse files
committed
update num_commits to account for multiple aliases per email
1 parent 7939472 commit 7ff788c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rever/authors.xsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,9 @@ def update_metadata(filename, write=True, validation_error=True):
301301
cpe = vcsutils.commits_per_email()
302302
fcpe = None
303303
for x in y:
304-
x["num_commits"] = cpe.get(x["email"], 0) + sum([cpe.get(a, 0) for a in x.get("alternate_emails", [])])
304+
# if duplicate nicknames A <foo@example>, A B <foo@example>
305+
unique_emails = set([x["email"]] + x.get("alternate_emails", []))
306+
x["num_commits"] = sum([cpe.get(a, 0) for a in unique_emails])
305307
# only compute first commits if needed.
306308
if "first_commit" not in x:
307309
if fcpe is None:

0 commit comments

Comments
 (0)