[openssl-commits] [tools] master update

Richard Levitte levitte at openssl.org
Tue Jun 20 13:45:57 UTC 2017


The branch master has been updated
       via  a1f9fa9d7592c91f0bb7eee4828d587063843a52 (commit)
       via  e2b3a71e500434b3462748aa8dbbfab2c7e8101b (commit)
       via  6dc421b7a640888202cfb69c795d36df524a52a9 (commit)
       via  59c0d003c6841b2e841401194e83893e727f6196 (commit)
      from  138c39c5d96593910bbacb569c27e914a137eeb7 (commit)


- Log -----------------------------------------------------------------
commit a1f9fa9d7592c91f0bb7eee4828d587063843a52
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jun 20 15:22:48 2017 +0200

    gitaddrev: in verbose mode, tell when CLA: Trivial was detected

commit e2b3a71e500434b3462748aa8dbbfab2c7e8101b
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jun 20 15:12:28 2017 +0200

    gitaddrev: remove ending blank lines from commit message before processing it

commit 6dc421b7a640888202cfb69c795d36df524a52a9
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jun 20 15:10:14 2017 +0200

    gitaddrev: the --trivial option is outdated, check the commit message instead

commit 59c0d003c6841b2e841401194e83893e727f6196
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jun 20 15:06:32 2017 +0200

    addrev: remove options that were never implemented

-----------------------------------------------------------------------

Summary of changes:
 review-tools/addrev    |  6 ------
 review-tools/gitaddrev | 41 +++++++++++++++++++----------------------
 2 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/review-tools/addrev b/review-tools/addrev
index 169f381..8da2b03 100755
--- a/review-tools/addrev
+++ b/review-tools/addrev
@@ -77,14 +77,8 @@ option style arguments:
 --commit=<id>		Only apply to commit <id>
 --myemail=<email>	Set email address.  Defaults to the result from
 			git configuration setting user.email.
---trivial		Add a "CLA: trivial" to the message.
---addcla		Add a CLA header for the author of the commit
 --nopr			Do not requre a PR number.
 --prnum=NNN             Add a reference to GitHub pull request NNN
---clatype=<type>	Only add a CLA header of the specified type. <type> is
-			either C for Corporate or I for Individual
---clamatch=<str>	Only add a CLA where <str> appears somewhere in the
-			description (i.e. the third column of cladb.txt)
 -<n>			Change the last <n> commits.  Defaults to 1.
 
 non-option style arguments can be:
diff --git a/review-tools/gitaddrev b/review-tools/gitaddrev
index 8dd3682..e1b5f9a 100755
--- a/review-tools/gitaddrev
+++ b/review-tools/gitaddrev
@@ -17,7 +17,6 @@ my $found = 0;
 my $num = 0;
 my $refuse = 0;
 my $prnum = 0;
-my $trivial = 0;
 my $verbose = 0;
 
 my $query = OpenSSL::Query->new();
@@ -54,6 +53,9 @@ sub try_add_reviewer {
     return $rc;
 }
 
+my @commit_message = map { (my $x = $_) =~ s|\R$||; $x } <STDIN>;
+my $trivial = !! grep(/^CLA:\s*Trivial\s*$/i, @commit_message);
+
 foreach (@ARGV) {
     if (/^--list$/) {
 	my %list = ();
@@ -90,8 +92,6 @@ foreach (@ARGV) {
         $rmrev = 1;
     } elsif (/^--myemail=(.+\@.+)$/) {
 	try_add_reviewer($1);
-    } elsif (/^--trivial$/) {
-        $trivial = 1;
     } elsif (/^--verbose$/) {
 	$verbose = 1;
     }
@@ -137,6 +137,8 @@ if (@nocla_reviewers) {
     die "Reviewers without CLA: ", join(", ", @nocla_reviewers), "\n";
 }
 
+print STDERR "Detected trivial marker\n" if $verbose && $trivial;
+
 print STDERR "Going with these reviewers:\n  ", join("\n  ", @reviewers), "\n"
     if $verbose;
 
@@ -172,35 +174,30 @@ if (scalar @reviewers == 0 && $rmrev == 0) {
     die "No reviewer set!\n";
 }
 
-my $last_line_blank = 0;
-my $have_rev = 0;
-while(<STDIN>) {
+# Remove blank lines from the end of commit message
+pop @commit_message while $commit_message[$#commit_message] =~ m|^\s*$|;
+
+my $last_is_rev = 0;
+foreach (@commit_message) {
+    # Start each line with assuming it's not a reviewed-by line
+    $last_is_rev = 0;
     if (/^\(Merged from https:\/\/github\.com\/openssl\/openssl\/pull\//
 	|| /^Reviewed-by:\s*(\S.*\S)\s*$/) {
+        my $id = $1;
         next if $rmrev == 1;
-        $have_rev = 1;
-        # Skip if reviewer already in list
-        next if $1 && grep { $1 eq $_ } @reviewers;
+        $last_is_rev = 1;
+        # Remove reviewers that are already in the message from our reviewer list
+        @reviewers = grep { $_ ne $id } @reviewers if $id;
     }
-    print;
-    $last_line_blank = ($_ =~ /^\s*$/);
+    print $_,"\n";
 }
 if ($rmrev == 0) {
-    #Add a blank line unless the last one is already blank or a review line
-    print "\n" unless $last_line_blank || $have_rev;
+    #Add a blank line unless the last one is a review line
+    print "\n" unless $have_rev;
     foreach(@reviewers) {
 	print "Reviewed-by: $_\n";
     }
-    if ($trivial) {
-        print "CLA: trivial\n";
-    }
 }
 
 print "(Merged from https://github.com/openssl/openssl/pull/$prnum)\n"
     if $prnum;
-
-my $email = $ENV{GIT_AUTHOR_EMAIL};
-
-if (!$trivial && !$query->has_cla(lc $email)) {
-    warn "\n\nWARNING: No CLA found for $email\n";
-}


More information about the openssl-commits mailing list