Skip to content

Commit 2faacf1

Browse files
crgeddeswghoffa
authored andcommitted
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>
1 parent 470d97b commit 2faacf1

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/build/tools/addCopyright.pl

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,23 +1100,21 @@ sub getFileContributors
11001100
my $gitAuthors = `git log --follow --find-copies-harder -C85% -M85% --pretty="%aN <%aE>" -- $filename | sort | uniq`;
11011101
my @gitAuthors = split('\n', $gitAuthors);
11021102

1103-
# Add current commiter.
1103+
# Get commit's author
11041104
# If running copyright_check run 'git log' as a commit is not taking place
1105-
# Otherwise check using 'git config' as this is a pre-commit hook
1106-
my $curAuthorEmail = "";
1107-
if ($copyright_check)
1108-
{
1109-
$curAuthorEmail = `git log -n1 --pretty=format:"%aN <%aE>"`;
1110-
chomp($curAuthorEmail);
1111-
}
1112-
else
1105+
# Else we currently have no way of getting the current author. Because
1106+
# this is a pre-commit hook, the commit staged to be committed does not
1107+
# show up in 'git log' until commit has completed. We cannot look up
1108+
# current user's info because the user pushing the commit may not be
1109+
# the author.
1110+
1111+
if($copyright_check)
11131112
{
1114-
my $curAuthorName = `git config user.name`;
1115-
$curAuthorEmail = `git config user.email`;
1113+
my $curAuthorEmail = `git log -n1 --pretty=format:"%aN <%aE>"`;
11161114
chomp($curAuthorEmail);
1117-
$curAuthorEmail = "$curAuthorName <".$curAuthorEmail.">";
1115+
push(@gitAuthors, $curAuthorEmail);
11181116
}
1119-
push(@gitAuthors, $curAuthorEmail);
1117+
11201118
foreach my $contributor (@gitAuthors)
11211119
{
11221120
my $companyExists = 0;

0 commit comments

Comments
 (0)