Skip to content

Commit affd54b

Browse files
committed
gerrit-push-for: Ensure unique reviewers
If authors use different names with the same email address, we might get duplicate email addresses that we need to filter out.
1 parent a47aa87 commit affd54b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gerrit/gerrit-push-for.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if [ $skip -eq 0 ]; then
100100
if [ $? -eq 0 ]; then
101101
echo "Determining reviewers..."
102102
user=$(git config user.name)
103-
reviewers=$(git contacts $remote/$target..$ref 2> /dev/null | grep -iv "$user" | cut -d "<" -f 2 | cut -d ">" -f 1)
103+
reviewers=$(git contacts $remote/$target..$ref 2> /dev/null | grep -iv "$user" | cut -d "<" -f 2 | cut -d ">" -f 1 | uniq)
104104
if [ -f ~/gerrit-push-for.blacklist ]; then
105105
dos2unix -k ~/gerrit-push-for.blacklist 2> /dev/null
106106
reviewers=$(echo "$reviewers" | grep -vf ~/gerrit-push-for.blacklist)

0 commit comments

Comments
 (0)