Created
July 12, 2012 16:03
-
-
Save sbenthall/3099040 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
import datetime | |
from git import * | |
from operator import itemgetter | |
import os | |
from pprint import pprint as pp | |
repo = Repo(os.getcwd()) | |
six_months_ago = (datetime.date.today() - datetime.timedelta(183)).isoformat() | |
commits = repo.iter_commits(after=six_months_ago) | |
authors = defaultdict(int) | |
for commit in commits: | |
authors[commit.author.name] += 1 | |
rank_authors = sorted(authors.items(),key=itemgetter(1), reverse=True) | |
pp(rank_authors) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment