diff options
author | varac <varacanero@zeromail.org> | 2017-05-31 23:15:31 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2017-05-31 23:15:31 +0200 |
commit | f0888c835d830e69526603c44128d9ee44e67333 (patch) | |
tree | d8f3236d84317d2f39cd7c53810757642805927f | |
parent | 20a7c1eac51e8e8c7044555f70d456bc6c3659a0 (diff) |
Finish get_contributors.sh
-rwxr-xr-x | get_contributors.sh | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/get_contributors.sh b/get_contributors.sh index 49ed580..eaae0d0 100755 --- a/get_contributors.sh +++ b/get_contributors.sh @@ -9,30 +9,31 @@ REPOS=(bitmask_android bitmask_bundler bitmask_client bitmask-dev bitmask_help b # 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 +declare -A contributors 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" ] + contributors_repo=$(eval "$GET_CONTRIBUTORS" | egrep --text -iv "$TEAM") + if [ -n "$contributors_repo" ] then echo "${repo}:" - echo "$contributors" | tee -a ${LISTFILE}.tmp + while read -r line; do + echo "$line" + contributors["$line"]+="$repo, " + done <<< "$contributors_repo" echo echo fi done +echo +echo -sort < "${LISTFILE}.tmp" | uniq > "${LISTFILE}" -rm "${LISTFILE}.tmp" -echo "Complete list of contributors is at ${LISTFILE}" +for contributor in "${!contributors[@]}"; do echo "$contributor: ${contributors[$contributor]}"; done | sort |