From f0dab5c70d0ebae48b43415904ca53a7ceea1ba0 Mon Sep 17 00:00:00 2001 From: crgeddes Date: Wed, 11 May 2016 13:48:23 -0500 Subject: Remove the copyright_check that was adding submitter to prolog contributor The addCopyright script was failing in hostboot-ci because when it was ran on standalone it would add the current submitter of the commit as a contributor and when it ran on ci it would add the author of the commit as a contributor. In the past these two have been the same, however if we were to merge a pull request from a third-party who was not and IBMer we would fail CI. Now it will only check the author if the copyright_check flag is set. Change-Id: I7a360a824d73a89872040932d2e7e3f8a334e770 RTC:117874 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24389 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Stephen M. Cprek Reviewed-by: Elizabeth K. Liner Tested-by: Jenkins OP HW Reviewed-by: William G. Hoffa Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24719 Reviewed-by: Christian R. Geddes --- src/build/tools/addCopyright.pl | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/build/tools/addCopyright.pl b/src/build/tools/addCopyright.pl index 3a922b3e0..000958c1e 100755 --- a/src/build/tools/addCopyright.pl +++ b/src/build/tools/addCopyright.pl @@ -1161,23 +1161,21 @@ sub getFileContributors my $gitAuthors = `git log --follow --find-copies-harder -C85% -M85% --pretty="%aN <%aE>" -- $filename | sort | uniq`; my @gitAuthors = split('\n', $gitAuthors); - # Add current commiter. + # Get commit's author # If running copyright_check run 'git log' as a commit is not taking place - # Otherwise check using 'git config' as this is a pre-commit hook - my $curAuthorEmail = ""; - if ($copyright_check) - { - $curAuthorEmail = `git log -n1 --pretty=format:"%aN <%aE>"`; - chomp($curAuthorEmail); - } - else + # Else we currently have no way of getting the current author. Because + # this is a pre-commit hook, the commit staged to be committed does not + # show up in 'git log' until commit has completed. We cannot look up + # current user's info because the user pushing the commit may not be + # the author. + + if($copyright_check) { - my $curAuthorName = `git config user.name`; - $curAuthorEmail = `git config user.email`; + my $curAuthorEmail = `git log -n1 --pretty=format:"%aN <%aE>"`; chomp($curAuthorEmail); - $curAuthorEmail = "$curAuthorName <".$curAuthorEmail.">"; + push(@gitAuthors, $curAuthorEmail); } - push(@gitAuthors, $curAuthorEmail); + foreach my $contributor (@gitAuthors) { my $companyExists = 0; -- cgit v1.2.1