| 45 | |
| 46 | |
| 47 | def get_authors_from_git(): |
| 48 | output = subprocess.run( |
| 49 | ["git", "log", "--format='%aN %aE'"], |
| 50 | capture_output=True, |
| 51 | check=True, |
| 52 | text=True, |
| 53 | ) |
| 54 | |
| 55 | authors_string = output.stdout |
| 56 | authors_list = authors_string.split("\n") |
| 57 | authors_without_quotes = [a.strip("'") for a in authors_list] |
| 58 | |
| 59 | distinct_authors = set(authors_without_quotes) |
| 60 | distinct_authors_list_without_empty_strings = [ |
| 61 | a.rsplit(maxsplit=1) for a in distinct_authors if a |
| 62 | ] |
| 63 | authors_with_emails = defaultdict(list) |
| 64 | for author, email in distinct_authors_list_without_empty_strings: |
| 65 | authors_with_emails[author].append(email) |
| 66 | |
| 67 | return authors_with_emails |
| 68 | |
| 69 | |
| 70 | def parse_cff_file(): |