From e078d6af296cec83a47dfb82a8f1bb3c506621cc Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Mon, 17 Apr 2017 22:15:28 +0300 Subject: [PATCH] Add script to automatically update AUTHORS file --- TODO | 2 -- devscripts/update-authors.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 devscripts/update-authors.sh diff --git a/TODO b/TODO index 2764923..d41f101 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,6 @@ Before new_layout branch merge ============================== * README.md update (pull-request #145) -* Script to automatically update file contents: - contributors : AUTHORS After new_layout merge diff --git a/devscripts/update-authors.sh b/devscripts/update-authors.sh new file mode 100755 index 0000000..e7919a8 --- /dev/null +++ b/devscripts/update-authors.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Author: Sotiris Papadopoulos +# Last-Revision: 2017-04-17 +# Script to update the AUTHORS file +# +# Usage: ./update-authors.sh + +cd .. + +git log --reverse --format="%aN <%aE>" | python -c " + +import sys + +authors = set() + +sys.stdout.write('# Authors ordered by first contribution.\n\n') + +for line in sys.stdin: + username, _ = line.split('<') + + if username not in authors: + authors.add(username) + sys.stdout.write(line) + +sys.stdout.write('\n# Generated by update-authors.sh script\n') +" > AUTHORS