1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Export all commits as ChangeLog when no starting commit is found [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2019-08-25 11:24:53 +09:00
parent 04735c48ab
commit f13a00f5b4
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -573,10 +573,17 @@ class VCS
end
rev unless rev.empty?
end
unless /./.match(from ||= branch_beginning(url))
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
range = [from, (to || 'HEAD')].join('^..')
end
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)