FIX: Match "Last, First M." pattern
#!/usr/bin/env python3
-import os
import git
import json
from subprocess import run, PIPE
from pathlib import Path
-from pprint import pprint
+
+
+def decommify(name):
+ return ' '.join(name.split(', ')[::-1])
+
# Last shablona commit
origin_commit = 'd72caaf5933907ed699d57faddaec7bfc836ce6f'
@@ -15,7 +18,8 @@ zenodo_file = git_root / '.zenodo.json'
zenodo = json.loads(zenodo_file.read_text()) if zenodo_file.exists() else {}
orig_creators = zenodo.get('creators', [])
-creator_map = {creator['name']: creator for creator in orig_creators}
+creator_map = {decommify(creator['name']): creator
+ for creator in orig_creators}
shortlog = run(['git', 'shortlog', '-ns', f'{origin_commit}..'], stdout=PIPE)
committers = [line.split('\t', 1)[1]
