diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-04-28 00:30:16 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-04-28 00:30:16 +0900 |
commit | bb6036946ef7337c8bef6380ba394c082d5452cb (patch) | |
tree | f79cb961c49efe575f92d90a0af0716caf406513 /tool | |
parent | 87d2a2df1b40016401a2f6dfc98e46880bbd18fd (diff) | |
download | ruby-bb6036946ef7337c8bef6380ba394c082d5452cb.tar.gz |
Reduce matz's work, let git do it instead
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/make-snapshot | 15 | ||||
-rw-r--r-- | tool/vcs.rb | 6 |
2 files changed, 10 insertions, 11 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot index 4e6818ac17..4ba1da522f 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -338,18 +338,11 @@ def package(vcs, rev, destdir, tmp = nil) def (clean = []).add(n) push(n); n end Dir.chdir(v) do unless File.exist?("ChangeLog") - # get last revision from previous ChangeLog archive - last_ChangeLog = Dir["doc/ChangeLog-*"].grep(/-(\d+)\z/) {|n| [$1.to_i, n]}.max[1] - open(last_ChangeLog) do |f| - if /\Acommit (\w+)/ =~ f.readline - beginning = $1 - elsif /\Ar(\d+) / =~ f.readline - beginning = $1.to_i - else - abort "#{File.basename $0}: Cannot find revision from '#{last_ChangeLog}'" - end - vcs.export_changelog(url, beginning, revision, "ChangeLog") + # get the beginning revision from matz's commit + unless beginning = vcs.branch_beginning + abort "#{File.basename $0}: Cannot find revision from '#{last_ChangeLog}'" end + vcs.export_changelog(url, beginning, revision, "ChangeLog") end File.open(clean.add("cross.rb"), "w") do |f| diff --git a/tool/vcs.rb b/tool/vcs.rb index 7f302c9437..6078f1a429 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -451,6 +451,12 @@ class VCS FileUtils.rm_rf(Dir.glob("#{dir}/.git*")) end + def branch_beginning + cmd_read(%W[ #{COMMAND} log -n1 --format=format:%H --reverse + --author=matz --committer=matz --grep=start + -- version.h include/ruby/version.h]) + end + def export_changelog(url, from, to, path) range = [from, to].map do |rev| rev or next |