From d57c3296a9f49dfa2c853194e4267edd794d405b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 12 Jan 2026 11:21:35 +0900 Subject: Re-fix `VCS::GIT#branch_beginning` Count the last release date from the whole working directory, not only the version headers. --- tool/lib/vcs.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tool') diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 6ebfb9e93b..26c9763c13 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -448,11 +448,10 @@ class VCS 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) @@ -460,7 +459,7 @@ class VCS 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 -- cgit v1.2.3