-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CONTRIB: Automate AUTHORS file update #10308
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this script to CI, so that if new author is adding a commit and it is not in AUTHORS file, the CI fails?
adding to CI imposes PR creators to have their commits under exact email, or name, could this become a problem at some point? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
contrib/authors_update.sh
Outdated
|
||
if [ ! -w AUTHORS ] | ||
then | ||
echo "AUTHORS file not accessible" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not writable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, but -w also covers the case where file does not exist
contrib/authors_update.sh
Outdated
|
||
set -eEu -o pipefail | ||
|
||
range="${1?Provide commit range like orig/v1.17..orig/v1.18}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like
-> , for example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
contrib/authors_update.sh
Outdated
lines=$(git log --no-merges --pretty=format:"%an%x09%ae" "$range" | sort | uniq) | ||
if [ -z "$lines" ] | ||
then | ||
echo "Error: empty range \"$range\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provided range is empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
contrib/authors_update.sh
Outdated
exit 1 | ||
fi | ||
|
||
if [ "$(git log --no-merges --oneline "$range" | wc -l)" -eq 0 ] | ||
# Failure message triggered if range is not valid | ||
lines=$(git log --no-merges --pretty=format:"%an%x09%ae" "$range" | sort | uniq) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: add "-u" flag to sort instead of pipe to uniq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
6a06aba
to
f8c7e7a
Compare
What?
Automate AUTHORS updates according to documentation.
Why?
Seems better to try to have common approach.
How?