diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index 436175b259..f93224c8d0 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -41,8 +41,9 @@ module Homebrew master_updater.pull! master_updated = master_updater.updated? if master_updated - puts "Updated Homebrew from #{master_updater.initial_revision[0, 8]} " \ - "to #{master_updater.current_revision[0, 8]}." + initial_short = shorten_revision(master_updater.initial_revision) + current_short = shorten_revision(master_updater.current_revision) + puts "Updated Homebrew from #{initial_short} to #{current_short}." end report.update(master_updater.report) @@ -133,6 +134,10 @@ module Homebrew private + def shorten_revision(revision) + `git rev-parse --short #{revision}`.chomp + end + def git_init_if_necessary if Dir[".git/*"].empty? safe_system "git", "init"