Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions tool/lib/vcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,18 @@ def export(revision, url, dir, keep_temp = false)
end

def branch_beginning(url)
files = %w[version.h include/ruby/version.h]
year = cmd_read(%W[ #{COMMAND} log -n1 --format=%cd --date=format:%Y #{url} --] + files).to_i
year = cmd_read(%W[ #{COMMAND} log -n1 --format=%cd --date=format:%Y #{url} --]).to_i
cmd_read(%W[ #{COMMAND} log --format=format:%H --reverse --since=#{year-1}-12-25
--author=matz --committer=matz --grep=started\\.$
#{url} --] + files)[/.*/]
#{url} -- version.h include/ruby/version.h])[/.*/]
end

def export_changelog(url = '@', from = nil, to = nil, _path = nil, path: _path, base_url: true)
from, to = [from, to].map do |rev|
rev or next
rev unless rev.empty?
end
unless (from && /./.match(from)) or ((from = branch_beginning(url)) && /./.match(from))
unless from&.match?(/./) or (from = branch_beginning(url))&.match?(/./)
warn "no starting commit found", uplevel: 1
from = nil
end
Expand Down