18 lines
445 B
Ruby
Raw Normal View History

module Homebrew extend self
def log
if ARGV.named.empty?
cd HOMEBREW_REPOSITORY
exec "git", "log", *ARGV.options_only
else
begin
2014-04-06 00:31:07 -05:00
path = ARGV.formulae.first.path
rescue FormulaUnavailableError
# Maybe the formula was deleted
2014-02-28 16:51:15 -06:00
path = Formula.path(ARGV.named.first)
end
cd path.dirname # supports taps
exec "git", "log", *ARGV.options_only + ["--", path]
end
end
end