ruby-changes:37557
From: nobu <ko1@a...>
Date: Wed, 18 Feb 2015 12:43:24 +0900 (JST)
Subject: [ruby-changes:37557] nobu:r49638 (trunk): version.c: last commit title
nobu 2015-02-18 12:43:14 +0900 (Wed, 18 Feb 2015) New Revision: 49638 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49638 Log: version.c: last commit title * version.c (ruby_show_version): show last commit title, if different than the trunk. Modified files: trunk/tool/file2lastrev.rb trunk/tool/vcs.rb trunk/version.c Index: version.c =================================================================== --- version.c (revision 49637) +++ version.c (revision 49638) @@ -78,6 +78,9 @@ void https://github.com/ruby/ruby/blob/trunk/version.c#L78 ruby_show_version(void) { PRINT(description); +#ifdef RUBY_LAST_COMMIT_TITLE + fputs("last_commit=" RUBY_LAST_COMMIT_TITLE, stdout); +#endif #ifdef HAVE_MALLOC_CONF if (malloc_conf) printf("malloc_conf=%s\n", malloc_conf); #endif Index: tool/vcs.rb =================================================================== --- tool/vcs.rb (revision 49637) +++ tool/vcs.rb (revision 49638) @@ -260,6 +260,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L260 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 https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L272 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) Index: tool/file2lastrev.rb =================================================================== --- tool/file2lastrev.rb (revision 49637) +++ tool/file2lastrev.rb (revision 49638) @@ -47,7 +47,7 @@ rescue VCS::NotFoundError => e https://github.com/ruby/ruby/blob/trunk/tool/file2lastrev.rb#L47 abort "#{File.basename(Program)}: #{e.message}" unless @suppress_not_found else begin - last, changed, modified, branch = vcs.get_revisions(ARGV.shift) + last, changed, modified, branch, title = vcs.get_revisions(ARGV.shift) rescue => e abort "#{File.basename(Program)}: #{e.message}" unless @suppress_not_found exit false @@ -65,6 +65,9 @@ when :revision_h https://github.com/ruby/ruby/blob/trunk/tool/file2lastrev.rb#L65 name = branch.sub(/\A(.{#{limit-e.size}}).{#{e.size+1},}/o) {$1+e} puts "#define RUBY_BRANCH_NAME #{name.dump}" end + if title + puts "#define RUBY_LAST_COMMIT_TITLE #{title.dump}" + end when :doxygen puts "r#{changed}/r#{last}" when :modified -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/