summaryrefslogtreecommitdiff
path: root/get_contributors.sh
blob: 49ed580b1c69fc1852186398c34310f526f48e3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

# Script to generate a list of contributors
# Included: All repos from https://leap.se/git/?o=age that show activity since 2y
# Excluded: puppet_*

REPOS=(bitmask_android bitmask_bundler bitmask_client bitmask-dev bitmask_help bitmask_launcher bitmask_net bitmask_thunderbird bonafide couchdb_scripts couchrest_changes deploy_test dl_bitmask_net docker faith keymanager leap_assets leap_ca leap_cli leap_client_launcher leap_cloudadmin leap_db leap_doc leap-keyring leap_mail leap_mx leap_pistonadmin leap_platform leap_presentations leap_pycommon leap_se leap_vagrant leap_web leap_website libsodium lut mail_breaker nickserver packer_vagrant platform_test pymemoryhole pysqlcipher python_gnupg-ng python_pycryptopp python_srp python_zmq reserve_usernames ruby_srp scripts soledad soledad-perf sqlcipher srp_js tapicero version_report )

# shellcheck disable=SC2016
GET_CONTRIBUTORS='git log --branches --not --remotes=subrepo --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
  # Uncomment for first run to make sure all repos are up to date
  # git fetch
  contributors=$(eval "$GET_CONTRIBUTORS" | egrep --text -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}"