summaryrefslogtreecommitdiffstats
path: root/src/build/tools/addCopyright.pl
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2016-05-11 13:48:23 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2016-05-18 12:40:15 -0400
commitf0dab5c70d0ebae48b43415904ca53a7ceea1ba0 (patch)
tree907f4cd1748a6653be86b362dd29da979f1018e8 /src/build/tools/addCopyright.pl
parentfaba45366783533757b3636b0dcf0db2a1b2497e (diff)
downloadblackbird-hostboot-f0dab5c70d0ebae48b43415904ca53a7ceea1ba0.tar.gz
blackbird-hostboot-f0dab5c70d0ebae48b43415904ca53a7ceea1ba0.zip
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 <smcprek@us.ibm.com> Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com> Tested-by: Jenkins OP HW Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24719 Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/build/tools/addCopyright.pl')
-rwxr-xr-xsrc/build/tools/addCopyright.pl24
1 files 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;
OpenPOWER on IntegriCloud