Add script to list all LEAP contributors
authorvarac <varacanero@zeromail.org>
Wed, 31 May 2017 18:07:07 +0000 (20:07 +0200)
committervarac <varacanero@zeromail.org>
Wed, 31 May 2017 18:07:07 +0000 (20:07 +0200)
get_contributors.sh [new file with mode: 0755]

diff --git a/get_contributors.sh b/get_contributors.sh
new file mode 100755 (executable)
index 0000000..175ecc4
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Script to generate a list of contributors
+
+REPOS=(bitmask_android bitmask_client bitmask-dev bonafide couchdb_scripts couchrest_changes deploy_test dl_bitmask_net docker faith Infrastructure junit keymanager leap_assets leap_ca leap_cli leap_client_dist leap_client_launcher leap_cloudadmin leap_db leap_mail leap_mx leap_pistonadmin leap_platform leap_platform_gource leap_presentations leap_pycommon leap_se leap_vagrant leap_web leap_website lut mail_breaker minimal-debian-vagrant nickserver platform_test pysqlcipher reserve_usernames ruby_srp scripts soledad tapicero )
+
+# shellcheck disable=SC2016
+GET_CONTRIBUTORS='git log --use-mailmap --format="%aN <%aE>" | awk "{arr[\$0]++} END{for (i in arr){print arr[i], i;}}" | sort -rn | cut -d" " -f2- | sort'
+ROOTDIR="${HOME}/leap/git"
+LISTFILE='/tmp/contributors.txt'
+
+# optional specify core team memebers to filter out
+TEAM='(email@of.contributor.org|email@of_other_contributor.net)'
+
+[ -e ${LISTFILE} ] && rm ${LISTFILE}
+[ -e ${LISTFILE}.tmp ] && rm ${LISTFILE}.tmp
+
+for repo in "${REPOS[@]}"
+do
+  cd "${ROOTDIR}/${repo}" || exit 1
+  contributors=$(eval "$GET_CONTRIBUTORS" | egrep -iv "$TEAM")
+  if [ -n "$contributors" ]
+  then
+    echo "${repo}:"
+    echo "$contributors" | tee -a ${LISTFILE}.tmp
+    echo
+    echo
+  fi
+done
+
+
+sort < "${LISTFILE}.tmp" | uniq  > "${LISTFILE}"
+rm "${LISTFILE}.tmp"
+echo "Complete list of contributors is at ${LISTFILE}"