diff --git a/extra/release/update-contributors.sh b/extra/release/update-contributors.sh new file mode 100755 index 0000000000..fe896b645a --- /dev/null +++ b/extra/release/update-contributors.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +function path_in_repo() +{ + echo "$(git rev-parse --show-toplevel)/$*" +} +function main() +{ + local new_contributors + new_contributors="$(mktemp libevent.XXXXXX)" + trap "rm $new_contributors $new_contributors.filtered" EXIT + + git log "$(git describe --abbrev=0)..HEAD" --pretty='format:%cN%n%aN' > "$new_contributors" + awk '/^ \* / { split($0, cols, " \\* "); print(cols[2]); }' "$(path_in_repo CONTRIBUTORS.md)" | { + grep -F -x -v -f "$new_contributors" + } | { + local grep_patterns=( + GitHub + ) + grep -F -x -v "${grep_patterns[@]}" + } > "$new_contributors.filtered" + awk '{printf(" * %s\n", $0)}' "$new_contributors.filtered" >> "$(path_in_repo CONTRIBUTORS.md)" +} +main "$@"