Skip to content

Commit

Permalink
update num_commits to account for multiple aliases per email
Browse files Browse the repository at this point in the history
  • Loading branch information
dholth committed Dec 5, 2022
1 parent 7939472 commit 7ff788c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rever/authors.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ def update_metadata(filename, write=True, validation_error=True):
cpe = vcsutils.commits_per_email()
fcpe = None
for x in y:
x["num_commits"] = cpe.get(x["email"], 0) + sum([cpe.get(a, 0) for a in x.get("alternate_emails", [])])
# if duplicate nicknames A <foo@example>, A B <foo@example>
unique_emails = set([x["email"]] + x.get("alternate_emails", []))
x["num_commits"] = sum([cpe.get(a, 0) for a in unique_emails])
# only compute first commits if needed.
if "first_commit" not in x:
if fcpe is None:
Expand Down

0 comments on commit 7ff788c

Please sign in to comment.