diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-18 03:43:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-18 03:43:14 +0000 |
commit | a8e289374a3162d98ec58833550c40e44092179b (patch) | |
tree | f254f165da47748b2d83ea97abc6e6982b7f03c4 /tool/vcs.rb | |
parent | 7d9f497f7ebde95ba2e15247ab55021872a7009b (diff) | |
download | ruby-a8e289374a3162d98ec58833550c40e44092179b.tar.gz |
version.c: last commit title
* version.c (ruby_show_version): show last commit title, if
different than the trunk.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/vcs.rb')
-rw-r--r-- | tool/vcs.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb index 1e087b6542..9d11b3b8c1 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -260,6 +260,7 @@ class VCS logcmd << "--grep=^ *git-svn-id: .*@[0-9][0-9]*" idpat = /git-svn-id: .*?@(\d+) \S+\Z/ log = IO.pread(logcmd) + commit = log[/\Acommit (\w+)/, 1] last = log[idpat, 1] if path cmd = logcmd @@ -271,7 +272,9 @@ class VCS end modified = log[/^Date:\s+(.*)/, 1] branch = IO.pread(gitcmd + %W[symbolic-ref HEAD])[%r'\A(?:refs/heads/)?(.+)', 1] - [last, changed, modified, branch] + title = IO.pread(gitcmd + ["log", "--format=%s", "-n1", "#{commit}..HEAD"]) + title = nil if title.empty? + [last, changed, modified, branch, title] end Branch = Struct.new(:to_str) |