Add an option to not add yourself as a reviewer
authorMatt Caswell <matt@openssl.org>
Fri, 8 Dec 2017 10:13:21 +0000 (10:13 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 5 Feb 2018 10:10:14 +0000 (10:10 +0000)
Every now and then I need to merge a commit that I did not author or
review (someone else has done those things). This adds an option to addrev
to enable you to add the "Reviewed by" headers without also adding
yourself.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6)

review-tools/addrev

index 6b3d64a5d721f982f30bf181243be7a84c3f6d43..fdf2aa53fcd8fc2a2be7a00016ffdf1e06382153 100755 (executable)
@@ -9,6 +9,7 @@ my $list_reviewers = 0;
 my $help = 0;
 my $haveprnum = 0;
 my $trivial = 0;
+my $useself = 1;
 
 my $my_email;
 
@@ -23,6 +24,8 @@ foreach (@ARGV) {
         $args .= "--trivial ";
     } elsif (/^--verbose$/) {
         $args .= "--verbose ";
+    } elsif (/^--noself$/) {
+        $useself = 0;
     } elsif (/^--myemail=(.+)$/) {
         $my_email = $1;
     } elsif (/^--nopr$/) {
@@ -56,11 +59,13 @@ if ($help) {
 
 die "Need either --prnum or --nopr flag" unless $haveprnum;
 
-if (!defined $my_email) {
-    $my_email = `git config --get user.email`;
-}
+if ($useself) {
+    if (!defined $my_email) {
+        $my_email = `git config --get user.email`;
+    }
 
-$args .= "--myemail=$my_email ";
+    $args .= "--myemail=$my_email ";
+}
 
 system("git filter-branch -f --tag-name-filter cat --msg-filter \"gitaddrev $args\" $filterargs");