diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index f1fd7409a4..caf46d6fb4 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -150,27 +150,32 @@ module Homebrew end def self.git_origin + return unless Utils.git_available? HOMEBREW_REPOSITORY.cd { `git config --get remote.origin.url 2>/dev/null`.chuzzle } end def self.git_head + return unless Utils.git_available? HOMEBREW_REPOSITORY.cd { `git rev-parse --verify -q HEAD 2>/dev/null`.chuzzle } end def self.git_short_head + return unless Utils.git_available? HOMEBREW_REPOSITORY.cd { `git rev-parse --short=4 --verify -q HEAD 2>/dev/null`.chuzzle } end def self.git_last_commit + return unless Utils.git_available? HOMEBREW_REPOSITORY.cd { `git show -s --format="%cr" HEAD 2>/dev/null`.chuzzle } end def self.git_last_commit_date + return unless Utils.git_available? HOMEBREW_REPOSITORY.cd { `git show -s --format="%cd" --date=short HEAD 2>/dev/null`.chuzzle } end def self.homebrew_version_string - if Utils.git_available? && (pretty_revision = git_short_head) + if pretty_revision = git_short_head last_commit = git_last_commit_date "#{HOMEBREW_VERSION} (git revision #{pretty_revision}; last commit #{last_commit})" else