Don't add the author to the unknown reviewers list
authorMatt Caswell <matt@openssl.org>
Tue, 8 Mar 2022 14:08:56 +0000 (14:08 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 10 Mar 2022 15:32:41 +0000 (15:32 +0000)
If the author is a known reviewer, don't add them to the unknown reviewers
list.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/tools/pull/107)

review-tools/gitaddrev

index c6ba49a388324936f61708ee910ecbaff854050d..d3cd3d12748e865d89ce764ecf25349315a7640c 100755 (executable)
@@ -37,25 +37,27 @@ sub try_add_reviewer {
     my $rc = undef;
     my $id2 = $id =~ /^\@(.*)$/ ? { github => $1 } : $id;
     my $rev = $query->find_person_tag($id2, 'rev');
-    if ($rev && (!defined $authorrev || $rev ne $authorrev)) {
-       my $cla = $query->has_cla(lc $rev);
-       if ($cla) {
-           unless (grep {$_ eq $rev} @reviewers) {
-               $otccount++ if $query->is_member_of($id2, 'otc');
-               push @reviewers, $rev;
-           }
-           $rc = $rev;
-       } else {
-           push @nocla_reviewers, $id
-               unless grep {$_ eq $id} @nocla_reviewers;
-       }
+    if ($rev) {
+        my $cla = $query->has_cla(lc $rev);
+        if ($cla) {
+            if (!defined $authorrev || $rev ne $authorrev) {
+                unless (grep {$_ eq $rev} @reviewers) {
+                    $otccount++ if $query->is_member_of($id2, 'otc');
+                    push @reviewers, $rev;
+                }
+                $rc = $rev;
+            }
+        } else {
+            push @nocla_reviewers, $id
+                unless grep {$_ eq $id} @nocla_reviewers;
+        }
     } else {
-       push @unknown_reviewers, $id
-           unless grep {$_ eq $id} @unknown_reviewers;
-       unless ($id =~ m|^.+\@.*$| && $query->has_cla(lc $id)) {
-           push @nocla_reviewers, $id
-               unless grep {$_ eq $id} @nocla_reviewers;
-       }
+        push @unknown_reviewers, $id
+            unless grep {$_ eq $id} @unknown_reviewers;
+        unless ($id =~ m|^.+\@.*$| && $query->has_cla(lc $id)) {
+            push @nocla_reviewers, $id
+                unless grep {$_ eq $id} @nocla_reviewers;
+        }
     }
     return $rc;
 }