libevent/extra/release/update-contributors.sh

25 lines
775 B
Bash
Raw Normal View History

2022-11-13 21:44:10 +01:00
#!/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)" | {
2022-11-20 23:11:00 +01:00
grep -F -x -v -f- "$new_contributors"
2022-11-13 21:44:10 +01:00
} | {
local grep_patterns=(
2022-11-20 23:11:00 +01:00
-e GitHub
2022-11-13 21:44:10 +01:00
)
grep -F -x -v "${grep_patterns[@]}"
2022-11-20 23:11:00 +01:00
} | sort -u > "$new_contributors.filtered"
2022-11-13 21:44:10 +01:00
awk '{printf(" * %s\n", $0)}' "$new_contributors.filtered" >> "$(path_in_repo CONTRIBUTORS.md)"
}
main "$@"