summaryrefslogtreecommitdiff
path: root/tool/file2lastrev.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-09-17 21:16:06 +0900
committerGitHub <noreply@github.com>2022-09-17 21:16:06 +0900
commit38a7a13ac6ed6bba2584def7d7121257eb85e051 (patch)
tree1c20408e50d0fdd78e6277d9fa2dea05d785a88f /tool/file2lastrev.rb
parentca4cbe59eda77a3855094c843486759868794e85 (diff)
downloadruby-38a7a13ac6ed6bba2584def7d7121257eb85e051.tar.gz
Auto-generate the release date on version.h from git CommitDate (#6382)
* Auto-generate the release date on version.h from git CommitDate * Generate revision.h on mswin
Diffstat (limited to 'tool/file2lastrev.rb')
-rwxr-xr-xtool/file2lastrev.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb
index 008e4b55e5..476437a995 100755
--- a/tool/file2lastrev.rb
+++ b/tool/file2lastrev.rb
@@ -66,7 +66,13 @@ OptionParser.new {|opts|
new_vcs["."]
end
}
-exit unless vcs
+unless vcs
+ # Output only release_date when .git is missing
+ if @output == :revision_h
+ puts VCS.release_date(Time.now - 10) # same as make-snapshot
+ end
+ exit
+end
@output =
case @output
@@ -76,7 +82,7 @@ exit unless vcs
}
when :revision_h
Proc.new {|last, changed, modified, branch, title|
- vcs.revision_header(last, modified, branch, title, limit: @limit)
+ vcs.revision_header(last, modified, modified, branch, title, limit: @limit)
}
when :doxygen
Proc.new {|last, changed|