[前][次][番号順一覧][スレッド一覧]

ruby-changes:57242

From: Nobuyoshi <ko1@a...>
Date: Sun, 25 Aug 2019 11:25:18 +0900 (JST)
Subject: [ruby-changes:57242] Nobuyoshi Nakada: f13a00f5b4 (master): Export all commits as ChangeLog when no starting commit is found [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=f13a00f5b4

From f13a00f5b471f0f637c3f165daba235f24083bfc Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 25 Aug 2019 11:24:53 +0900
Subject: Export all commits as ChangeLog when no starting commit is found [ci
 skip]


diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb
index a65f1ff..3c06027 100644
--- a/tool/lib/vcs.rb
+++ b/tool/lib/vcs.rb
@@ -573,10 +573,17 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/lib/vcs.rb#L573
         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)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]