diff --git a/doc/_regexp.rdoc b/doc/_regexp.rdoc index b862c9a49e0594..76ac3a859e5b15 100644 --- a/doc/_regexp.rdoc +++ b/doc/_regexp.rdoc @@ -1251,7 +1251,7 @@ the potential vulnerability arising from this is the {regular expression denial- \Regexp matching can apply an optimization to prevent ReDoS attacks. When the optimization is applied, matching time increases linearly (not polynomially or exponentially) -in relation to the input size, and a ReDoS attach is not possible. +in relation to the input size, and a ReDoS attack is not possible. This optimization is applied if the pattern meets these criteria: diff --git a/tool/commit-email.rb b/tool/commit-email.rb index f738261dcca6cd..c887f8783e9d30 100755 --- a/tool/commit-email.rb +++ b/tool/commit-email.rb @@ -121,7 +121,7 @@ def build_diff(path, numstats) end def git_show(revision, format:) - git('show', "--pretty=#{format}", '--no-patch', revision).strip + git('show', '--no-show-signature', "--pretty=#{format}", '--no-patch', revision).strip end def git(*args) @@ -180,7 +180,7 @@ def main(repo_path, to, rest) args, options = parse(rest) infos = args.each_slice(3).flat_map do |oldrev, newrev, refname| - revisions = IO.popen(['git', 'log', '--reverse', '--pretty=%H', "#{oldrev}^..#{newrev}"], &:read).lines.map(&:strip) + revisions = IO.popen(['git', 'log', '--no-show-signature', '--reverse', '--pretty=%H', "#{oldrev}^..#{newrev}"], &:read).lines.map(&:strip) revisions[0..-2].zip(revisions[1..-1]).map do |old, new| GitInfoBuilder.new(repo_path).build(old, new, refname) end @@ -211,7 +211,7 @@ def b_encode(str) end def make_body(info, viewer_uri:) - body = '' + body = +'' body << "#{info.author}\t#{format_time(info.date)}\n" body << "\n" body << " New Revision: #{info.revision}\n" @@ -276,7 +276,6 @@ def modified_dirs(info) end def changed_dirs_info(info, uri) - rev = info.revision (info.added_dirs.collect do |dir| " Added: #{dir}\n" end + info.deleted_dirs.collect do |dir| @@ -293,14 +292,11 @@ def diff_info(info, uri) values.collect do |type, value| case type when :added - command = 'cat' rev = "?revision=#{info.revision}&view=markup" when :modified, :property_changed - command = 'diff' prev_revision = (info.revision.is_a?(Integer) ? info.revision - 1 : "#{info.revision}^") rev = "?r1=#{info.revision}&r2=#{prev_revision}&diff_format=u" when :deleted, :copied - command = 'cat' rev = '' else raise "unknown diff type: #{value[:type]}" @@ -328,7 +324,7 @@ def make_header(to, from, info) end def make_subject(info) - subject = '' + subject = +'' subject << "#{info.revision}" subject << " (#{info.branch})" subject << ': ' diff --git a/tool/test/test_commit_email.rb b/tool/test/test_commit_email.rb index efd45022be0bab..b948987ed96411 100644 --- a/tool/test/test_commit_email.rb +++ b/tool/test/test_commit_email.rb @@ -20,12 +20,11 @@ def setup end @sendmail = File.join(Dir.mktmpdir, 'sendmail') - File.write(@sendmail, <<~SENDMAIL) - #!/usr/bin/env ruby - print #{STDIN_DELIMITER.dump} - puts STDIN.read + File.write(@sendmail, <<~SENDMAIL, mode: "wx", perm: 0755) + #!/bin/sh + echo #{STDIN_DELIMITER.chomp.dump} + exec cat SENDMAIL - FileUtils.chmod(0755, @sendmail) @commit_email = File.expand_path('../../tool/commit-email.rb', __dir__) end