|
28 | 28 |
|
29 | 29 | emails = SVN_TO_EMAILS[svn_account_name] |
30 | 30 |
|
31 | | -ARGV.each_slice(3) do |oldrev, newrev, refname| |
32 | | - out, = Open3.capture2("git", "log", "--pretty=format:%H\n%ce", "-z", oldrev + ".." + newrev) |
33 | | - |
34 | | - out.split("\0").reverse_each do |s| |
35 | | - hash, git_committer_email = s.split("\n") |
36 | | - if emails |
37 | | - if emails == git_committer_email || emails.include?(git_committer_email) |
38 | | - # OK |
39 | | - else |
40 | | - puts "Your ssh key is not associated to the git committer email." |
41 | | - puts "Please see https://github.com/ruby/ruby-commit-hook/blob/master/bin/check-email.rb" |
42 | | - puts "and send PR, or contact on ruby-core@ruby-lang.org." |
43 | | - exit 1 # NG |
44 | | - end |
| 31 | +ARGV.each_slice(3) do |_oldrev, newrev, _refname| |
| 32 | + out, = Open3.capture2("git", "show", "-s", "--pretty=format:%H\n%ce", newrev) |
| 33 | + |
| 34 | + hash, git_committer_email = out.split("\n") |
| 35 | + if emails |
| 36 | + if emails == git_committer_email || emails.include?(git_committer_email) |
| 37 | + # OK |
| 38 | + else |
| 39 | + puts "Your ssh key is not associated to the git committer email." |
| 40 | + puts "Please see https://github.com/ruby/ruby-commit-hook/blob/master/bin/check-email.rb" |
| 41 | + puts "and send PR, or contact on ruby-core@ruby-lang.org." |
| 42 | + exit 1 # NG |
| 43 | + end |
| 44 | + else |
| 45 | + if Time.now > Time.new(2020, 1, 1) |
| 46 | + puts "Your ssh key is unknown." |
| 47 | + puts "Please see https://github.com/ruby/ruby-commit-hook/blob/master/bin/check-email.rb" |
| 48 | + puts "and send PR, or contact on ruby-core@ruby-lang.org." |
| 49 | + exit 1 # NG |
45 | 50 | else |
46 | | - if Time.now > Time.new(2020, 1, 1) |
47 | | - puts "Your ssh key is unknown." |
48 | | - puts "Please see https://github.com/ruby/ruby-commit-hook/blob/master/bin/check-email.rb" |
49 | | - puts "and send PR, or contact on ruby-core@ruby-lang.org." |
50 | | - exit 1 # NG |
51 | | - else |
52 | | - # Until the last of 2019, we record the association of SVN_ACCOUNT_NAME and GIT_COMMITTER_EMAIL. |
53 | | - open(LOG_FILE, "a") do |f| |
54 | | - f.puts "#{ hash } #{ svn_account_name } #{ git_committer_email }" |
55 | | - end |
| 51 | + # Until the last of 2019, we record the association of SVN_ACCOUNT_NAME and GIT_COMMITTER_EMAIL. |
| 52 | + open(LOG_FILE, "a") do |f| |
| 53 | + f.puts "#{ hash } #{ svn_account_name } #{ git_committer_email }" |
56 | 54 | end |
57 | 55 | end |
58 | 56 | end |
|
0 commit comments