aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/log.rb
blob: ca005d553f2304131aa93be2c0d33735a74f6307 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Homebrew extend self
  def log
    if ARGV.named.empty?
      cd HOMEBREW_REPOSITORY
      exec "git", "log", *ARGV.options_only
    else
      begin
        path = ARGV.formulae.first.path.realpath
      rescue FormulaUnavailableError
        # Maybe the formula was deleted
        path = Formula.path(ARGV.named.first)
      end
      cd path.dirname # supports taps
      exec "git", "log", *ARGV.options_only + ["--", path]
    end
  end
end