forked from libevent/libevent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script to add new contributors
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "$@" |