diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-01-12 11:21:35 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-01-12 11:28:06 +0900 |
| commit | d57c3296a9f49dfa2c853194e4267edd794d405b (patch) | |
| tree | fd69ee5b70a03225a20cdbd10e2e12ba68d1eb6f /tool | |
| parent | 61c372a1b7fe045adc9b67196503f29b79bff376 (diff) | |
Re-fix `VCS::GIT#branch_beginning`
Count the last release date from the whole working directory, not
only the version headers.
Diffstat (limited to 'tool')
| -rw-r--r-- | tool/lib/vcs.rb | 7 |
1 files changed, 3 insertions, 4 deletions
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 |
