From 8642ccd89978c3c95d834fe5d7ccb35d9b172685 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 19 Jun 2014 08:19:24 +0200 Subject: [PATCH] Use a python script for generate_authors --- scripts/generate_authors.py | 16 ++++++++++++++++ scripts/generate_authors.sh | 9 --------- 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 scripts/generate_authors.py delete mode 100755 scripts/generate_authors.sh diff --git a/scripts/generate_authors.py b/scripts/generate_authors.py new file mode 100644 index 000000000..4304b67f7 --- /dev/null +++ b/scripts/generate_authors.py @@ -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') diff --git a/scripts/generate_authors.sh b/scripts/generate_authors.sh deleted file mode 100755 index 78f4821c3..000000000 --- a/scripts/generate_authors.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# Inspired by herbstluftwm. - -cat > AUTHORS <