diff options
author | Takashi Kokubun <[email protected]> | 2022-09-17 21:16:06 +0900 |
---|---|---|
committer | <[email protected]> | 2022-09-17 21:16:06 +0900 |
commit | 38a7a13ac6ed6bba2584def7d7121257eb85e051 () | |
tree | 1c20408e50d0fdd78e6277d9fa2dea05d785a88f /tool/lib/vcs.rb | |
parent | ca4cbe59eda77a3855094c843486759868794e85 (diff) |
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
Notes: Merged-By: k0kubun <[email protected]>
-rw-r--r-- | tool/lib/vcs.rb | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -95,6 +95,15 @@ class VCS opts end attr_reader :srcdir def initialize(path) @@ -204,7 +213,8 @@ class VCS revision_handler(rev).short_revision(rev) end - def revision_header(last, modified = nil, branch = nil, title = nil, limit: 20) short = short_revision(last) if /[^\x00-\x7f]/ =~ title and title.respond_to?(:force_encoding) title = title.dup.force_encoding("US-ASCII") @@ -225,10 +235,11 @@ class VCS title = title.dump.sub(/\\#/, '#') code << "#define RUBY_LAST_COMMIT_TITLE #{title}" end - if modified - t = modified.utc code << t.strftime('#define RUBY_RELEASE_DATETIME "%FT%TZ"') end code end @@ -386,7 +397,10 @@ class VCS end class GIT < self - register(".git") {|path, dir| File.exist?(File.join(path, dir))} COMMAND = ENV["GIT"] || 'git' def cmd_args(cmds, srcdir = nil) |