From 8a248107e11494c21cb6cf1e2eb1229c3af9658b Mon Sep 17 00:00:00 2001 From: Andrew <635596+therealbnut@users.noreply.github.com> Date: Tue, 27 Jun 2023 19:20:55 +1000 Subject: [PATCH] Allow opt-out of PII in CONTRIBUTORS.txt (#2453) * Update CONTRIBUTORS.txt * Update generate_contributors_list.sh to allow removed emails * Removed from mailmap too * Remove entries instead --- .mailfilter | 6 ++++++ .mailmap | 1 - CONTRIBUTORS.txt | 23 ++++++++++++++++++++++- scripts/generate_contributors_list.sh | 16 ++++++++++++++-- 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 .mailfilter diff --git a/.mailfilter b/.mailfilter new file mode 100644 index 000000000..621d268f4 --- /dev/null +++ b/.mailfilter @@ -0,0 +1,6 @@ +# This is a list of `shasum` hashed email addresses which are filtered from CONTRIBUTORS.txt, typically for privacy. +# Lines can be generated by running `echo -n 'My Name ' | shasum | head -c 40`. + +38268a29b340ecfb435c5e6c5827a596acb71cc6 +886d1da6503c6de1d630beaf6acb667e4ce3e2a0 +f0c2beeae30f3012fa02257998baca1737540bda diff --git a/.mailmap b/.mailmap index ef0561ae1..4ae32128c 100644 --- a/.mailmap +++ b/.mailmap @@ -31,7 +31,6 @@ Jovan Milenkovic Nathan Harris Sergo Beruashvili <2391557+ogres@users.noreply.github.com> Sergej Jaskiewicz -Andrew Bennett <635596+therealbnut@users.noreply.github.com> Siemen Sikkema Dario Rexin Romain Pouclet diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 6b1ba5ba6..907295a52 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -14,13 +14,15 @@ needs to be listed here. - 0xflotus <0xflotus@gmail.com> - Adam Fowler - Adam Nemecek +- Ahmad Alhashemi - Albert Aleksieiev - Alex Blewitt - Alex Reilly -- Andrew Bennett - Andrew Edwards - Andrew Naylor +- Andrew Trick - Andrius Aucinas +- Anish Aggarwal - Ankit Aggarwal - Antoine Cœur - Antwan van Houdt @@ -51,7 +53,9 @@ needs to be listed here. - Esteban Torres - Eugen - Fabian Fett +- Felix Schlegel - Finagolfin +- Florian Friedrich - Frank Kair - Franz Busch - Gautier Delorme @@ -62,8 +66,10 @@ needs to be listed here. - GuangGuang - Guillaume Lessard - Gwynne Raskind +- Gwynne Raskind - Hailong - Heidi Puk Hermann +- Helder Sérvio <41337686+heldersrvio@users.noreply.github.com> - Helge Heß - Ian Partridge - Ilya Puchka @@ -97,6 +103,7 @@ needs to be listed here. - Liam Flynn - Ludovic Dewailly - Luo Xiu +- Mahdi Bahrami - Marcus Liotta - Mario Sangiorgio - Markus Jais @@ -104,6 +111,7 @@ needs to be listed here. - Marli Oshlack - Matt Eaton - Matteo Comisso +- Max Desiatov - Max Desiatov - Max Moiseev - Maxim Zaks @@ -114,14 +122,18 @@ needs to be listed here. - Norman Maurer - Ole Begemann - OleG +- Oleksandr Zhurba <69315809+mob-connection@users.noreply.github.com> - Paul Schmiedmayer - Peter Adams - Peter Tolsma - Petro Rovenskyy +- Philip Brown <122590765+asdf-bro@users.noreply.github.com> - Portia - Pushkar N Kulkarni - Pushparaj Zala - Richard Low +- Rick Newton-Rogers <104022490+rnro@users.noreply.github.com> +- Rick Newton-Rogers - Romain Pouclet - Rukshani Athapathu - Rémi Doreau @@ -152,11 +164,20 @@ needs to be listed here. - Volodymyr Sapsai - Will Lisac - Wilson Ding +- YR Chen +- Yim Lee - akash-55 <61596874+akash-55@users.noreply.github.com> +- buttaface +- carolinacass <67160898+carolinacass@users.noreply.github.com> +- dkz2 <132388278+dkz2@users.noreply.github.com> - fadi-botros - jemmons - pokryfka +- ser <122270051+ser-0xff@users.noreply.github.com> - sun_ +- taylorswift +- thomas-gill-0xff <115996764+thomas-gill-0xff@users.noreply.github.com> +- toluRV <111301355+toluRV@users.noreply.github.com> - trungducc **Updating this list** diff --git a/scripts/generate_contributors_list.sh b/scripts/generate_contributors_list.sh index 8bb870b11..0ee9929fb 100755 --- a/scripts/generate_contributors_list.sh +++ b/scripts/generate_contributors_list.sh @@ -15,7 +15,20 @@ set -eu here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -contributors=$( cd "$here"/.. && git shortlog -es | cut -f2 | sed 's/^/- /' ) +contributor_list=$( cd "$here"/.. && git shortlog -es | cut -f2 ) +filtered_hashes=$( cat "$here/../.mailfilter" | grep -E '^[a-z0-9]+$' | sort ) + +NL=$'\n' + +contributors='' +while IFS= read -r line; do + hashed="$(echo -n "$line" | shasum | head -c 40)" + found_hash=$(comm -12 <(echo "$hashed") <(echo "$filtered_hashes")) + if [ ! -z "$found_hash" ]; then + continue + fi + contributors="${contributors}- $line$NL" +done <<< "$contributor_list" cat > "$here/../CONTRIBUTORS.txt" <<- EOF For the purpose of tracking copyright, this is the list of individuals and @@ -32,7 +45,6 @@ cat > "$here/../CONTRIBUTORS.txt" <<- EOF ### Contributors $contributors - **Updating this list** Please do not edit this file manually. It is generated using \`./scripts/generate_contributors_list.sh\`. If a name is misspelled or appearing multiple times: add an entry in \`./.mailmap\`