INNER CODE UNIT · Python

group_by_author

emanuele-f/PCAPdroid · tools/weblate.py:135

def group_by_author(commits):
    """Return list of groups: {name, email, date, commits, message}."""
    groups = []
    for commit in commits:
        name, email, date, message = get_commit_info(commit)
        if groups and (groups[-1]["email"] == email):
            groups[-1]["commits"].append(commit)
            groups[-1]["date"] = date
            groups[-1]["message"] = message
        else:
            groups.append({
                "name": name,
                "email": email,
                "date": date,
                "commits": [commit],
                "message": message,
            })
    return groups

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…