Shows time since last commit in brew config

Closes Homebrew/homebrew#32936.
This commit is contained in:
Tim D. Smith 2014-10-04 16:09:48 -07:00
parent 26c76381c8
commit facb82e4bc
2 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,10 @@ module Homebrew
Homebrew.git_head || "(none)"
end
def last_commit
Homebrew.git_last_commit || "never"
end
def origin
origin = HOMEBREW_REPOSITORY.cd do
`git config --get remote.origin.url 2>/dev/null`.chomp
@ -121,6 +125,7 @@ module Homebrew
f.puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}"
f.puts "ORIGIN: #{origin}"
f.puts "HEAD: #{head}"
f.puts "Last commit: #{last_commit}"
f.puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}"
f.puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}"
f.puts hardware

View File

@ -119,6 +119,10 @@ module Homebrew
def self.git_head
HOMEBREW_REPOSITORY.cd { `git rev-parse --verify -q HEAD 2>/dev/null`.chuzzle }
end
def self.git_last_commit
HOMEBREW_REPOSITORY.cd { `git show -s --format="%cr" HEAD 2>/dev/null`.chuzzle }
end
end
def with_system_path