ruby-changes:55641
From: Nobuyoshi <ko1@a...>
Date: Wed, 1 May 2019 20:50:37 +0900 (JST)
Subject: [ruby-changes:55641] Nobuyoshi Nakada:474af9ee9a (trunk): No last commit when up-to-date
https://git.ruby-lang.org/ruby.git/commit/?id=474af9ee9a From 474af9ee9a4804d052e1e40503e1b6491d00a969 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 1 May 2019 20:47:00 +0900 Subject: No last commit when up-to-date Get the last commit title from the upstream to the head, so that no `last_commit` line will be shown when the branch is up to date with the upstream. diff --git a/tool/vcs.rb b/tool/vcs.rb index f4a10c8..f85b57e 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -402,7 +402,9 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L402 modified = log[/^Date:\s+(.*)/, 1] branch = cmd_read_at(srcdir, [gitcmd + %W[symbolic-ref --short HEAD]]) branch.chomp! - title = cmd_read_at(srcdir, [gitcmd + %W[log --format=%s -n1 FETCH_HEAD..HEAD]]) + upstream = cmd_read_at(srcdir, [gitcmd + %W[branch --list --format=%(upstream:short) #${branch}]]) + upstream.chomp! + title = cmd_read_at(srcdir, [gitcmd + %W[log --format=%s -n1 #{upstream}..HEAD]]) title = nil if title.empty? [last, changed, modified, branch, title] end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/