Use a python script for generate_authors
This commit is contained in:
parent
4eebf24775
commit
8642ccd899
16
scripts/generate_authors.py
Normal file
16
scripts/generate_authors.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
"""Re-generate the AUTHORS file based on the commits made."""
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
from collections import Counter
|
||||||
|
|
||||||
|
commits = subprocess.check_output(['git', 'log', '--format=%aN'])
|
||||||
|
cnt = Counter(commits.decode('utf-8').splitlines())
|
||||||
|
|
||||||
|
with open('AUTHORS', 'w', newline='\n', encoding='utf-8') as f:
|
||||||
|
f.write("Contributors, sorted by the number of commits in descending "
|
||||||
|
"order:\n\n")
|
||||||
|
for author in sorted(cnt, key=lambda k: cnt[k]):
|
||||||
|
f.write(author)
|
||||||
|
f.write('\n')
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Inspired by herbstluftwm.
|
|
||||||
|
|
||||||
cat > AUTHORS <<EOF
|
|
||||||
Contributors, sorted by the number of commits in descending order:
|
|
||||||
|
|
||||||
$(git log --format="%aN" | sort | uniq -c | sort -nr | sed 's/^[ ]*[^ ]*[ ]*//')
|
|
||||||
EOF
|
|
Loading…
Reference in New Issue
Block a user