'Returns a dictionary of release_id => commit metadata,
where each commit metadata dict contains commit_count
and an array of authors.
e.g.
1: {
\'latest_commit\': <Commit id=1>,
\'authors\': [<User id=1>, <User id=2>]'

def _get_commit_metadata(self, item_list, user):

    author_ids = set()
    for obj in item_list:
        author_ids.update(obj.authors)
    if author_ids:
        authors = list(CommitAuthor.objects.filter(id__in=author_ids))
    else:
        authors = []
    if authors:
        org_ids = set((item.organization_id for item in item_list))
        if (len(org_ids) != 1):
            users_by_author = {}
        else:
            users_by_author = get_users_for_authors(organization_id=org_ids.pop(), authors=authors, user=user)
    else:
        users_by_author = {}
    commit_ids = set((o.last_commit_id for o in item_list if o.last_commit_id))
    if commit_ids:
        commit_list = list(Commit.objects.filter(id__in=commit_ids).select_related('author'))
        commits = {c.id: d for (c, d) in izip(commit_list, serialize(commit_list, user))}
    else:
        commits = {}
    result = {}
    for item in item_list:
        item_authors = []
        seen_authors = set()
        for user in (users_by_author.get(a) for a in item.authors):
            if (user['email'] not in seen_authors):
                seen_authors.add(user['email'])
                item_authors.append(user)
        result[item] = {'authors': item_authors, 'last_commit': commits.get(item.last_commit_id)}
    return result
