2020-01-06 06:37:21 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-03-22 19:52:56 +01:00
|
|
|
set -eu -o pipefail ${SHELLFLAGS}
|
2020-01-06 06:37:21 +01:00
|
|
|
|
2020-01-15 11:34:10 +01:00
|
|
|
antispam=", at the domain "
|
|
|
|
|
2020-01-06 06:37:21 +01:00
|
|
|
headAuthor=$(git log -1 --pretty=format:'%ae')
|
2020-01-15 11:34:10 +01:00
|
|
|
authorAt=$(echo "$headAuthor" | sed "s/@/$antispam/")
|
2020-02-27 03:52:00 +01:00
|
|
|
if git log --pretty=format:'%ae' CONTRIBUTORS | grep -i "$headAuthor" > /dev/null; then
|
2020-12-09 12:15:38 +01:00
|
|
|
echo "Author found in CONTRIBUTORS"
|
2020-01-15 09:33:32 +01:00
|
|
|
else
|
2020-12-09 12:01:11 +01:00
|
|
|
echo "All contributors:"
|
|
|
|
git log --pretty=format:' - %ae' CONTRIBUTORS |sort |uniq |sort -f | sed "s/@/$antispam/"
|
|
|
|
|
2020-01-15 11:34:10 +01:00
|
|
|
echo "Author $authorAt NOT found in list"
|
2020-12-09 12:15:38 +01:00
|
|
|
echo
|
|
|
|
cat <<EOF
|
|
|
|
Please make sure you modify the CONTRIBUTORS file using the email address you
|
|
|
|
are committing from. If you have GitHub configured to hide your email address,
|
|
|
|
you may need to make a change to the CONTRIBUTORS file using the GitHub UI,
|
|
|
|
then try again.
|
|
|
|
EOF
|
2020-01-15 09:33:32 +01:00
|
|
|
exit 1
|
|
|
|
fi
|