Automatically generate contributors list in release notes.

Fixes #6544.

Closes #6562.

PiperOrigin-RevId: 219498863
diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh
index c1598c6..6557cef 100755
--- a/scripts/release/relnotes.sh
+++ b/scripts/release/relnotes.sh
@@ -124,8 +124,9 @@
 # Create the release notes since commit $1 ($2...${[#]} are the cherry-picks,
 # so the commits to ignore.
 function __release_notes() {
+  local last_release=$1
   local i
-  local commits=$(__get_release_notes_commits $@)
+  local commits=$(__get_release_notes_commits $last_release)
   local length="${#RELNOTES_TYPES[@]}"
   __generate_release_notes "$commits"
   for (( i=0; $i < $length; i=$i+1 )); do
@@ -140,6 +141,17 @@
       echo
     fi
   done
+
+  # Add a list of contributors to thank.
+  local external_authors=$(git log $last_release..HEAD --format="%aN <%aE>" \
+    | sort \
+    | uniq \
+    | grep -v "google.com" \
+    | sed -e 's/[[:space:]]$//' \
+    | tr '\n' ',' \
+    | sed -e 's/,$/\n/' \
+    | sed -e 's/,/, /g')
+  echo "This release contains contributions from many people at Google, as well as ${external_authors}."
 }
 
 # A wrapper around all the previous function, using the CHANGELOG.md