git: Fix nondeterministic ordering of commit authors.

This should fix the nondeterministic test failures introduced by
e7455e276b.
This commit is contained in:
Tim Abbott
2017-04-21 11:44:37 -07:00
parent e7455e276b
commit e7974b3b65
2 changed files with 4 additions and 2 deletions

View File

@@ -190,7 +190,9 @@ def get_all_committers(commits_data):
for commit in commits_data:
committers[commit['name']] += 1
committers_items = sorted(list(committers.items()), key=lambda item: item[1], reverse=True) # type: List[Tuple[str, int]]
# Sort by commit count, breaking ties alphabetically.
committers_items = sorted(list(committers.items()),
key=lambda item: (-item[1], item[0])) # type: List[Tuple[str, int]]
committers_values = [c_i[1] for c_i in committers_items] # type: List[int]
if len(committers) > PUSH_COMMITTERS_LIMIT_INFO: