aboutsummaryrefslogtreecommitdiffstats
path: root/tool/lib/vcs.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-25 11:24:53 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-25 11:24:53 +0900
commitf13a00f5b471f0f637c3f165daba235f24083bfc (patch)
treefe49632c96ceeb3d1c9b4b1cd82e8d01da0b9d11 /tool/lib/vcs.rb
parent04735c48ab44c97cbfd5a5cd37f9a1696e2f5a2b (diff)
downloadruby-f13a00f5b471f0f637c3f165daba235f24083bfc.tar.gz
Export all commits as ChangeLog when no starting commit is found [ci skip]
Diffstat (limited to 'tool/lib/vcs.rb')
-rw-r--r--tool/lib/vcs.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb
index a65f1ffc49..3c06027ec1 100644
--- a/tool/lib/vcs.rb
+++ b/tool/lib/vcs.rb
@@ -573,10 +573,17 @@ class VCS
end
rev unless rev.empty?
end
- unless /./.match(from ||= branch_beginning(url))
- raise "cannot find the beginning revision of the branch"
+ if /./.match(from) or /./.match(from = branch_beginning(url))
+ from += "^"
+ else
+ warn "no starting commit found", uplevel: 1
+ from = cmd_pipe(%W[ #{COMMAND} log --format=format:%H --reverse --since=1\ year\ ago], &:gets)
+ from.strip!
+ unless /./.match(from)
+ raise "cannot find the beginning revision of the branch"
+ end
end
- range = [from, (to || 'HEAD')].join('^..')
+ range = [from, (to || 'HEAD')].join('..')
cmd_pipe({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'},
%W"#{COMMAND} log --format=medium --notes=commits --date=iso-local --topo-order #{range}", "rb") do |r|
format_changelog(r, path)