Skip to content

Commit

Permalink
Merge pull request #18464 from benknoble/bk/tap-info-commit
Browse files Browse the repository at this point in the history
feat(tap-info): display Git information about non-Core/non-API taps
  • Loading branch information
MikeMcQuaid authored Oct 1, 2024
2 parents 3a9f952 + 3429e74 commit 54d484d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Library/Homebrew/cmd/tap-info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def print_tap_info(taps)
info += "\nPrivate" if tap.private?
info += "\n#{tap.path} (#{tap.path.abv})"
info += "\nFrom: #{tap.remote.presence || "N/A"}"
info += "\norigin: #{tap.remote}" if tap.remote != tap.default_remote
info += "\nHEAD: #{tap.git_head || "(none)"}"
info += "\nlast commit: #{tap.git_last_commit || "never"}"
info += "\nbranch: #{tap.git_branch || "(none)"}" if tap.git_branch != "master"
else
info += "Not installed"
end
Expand Down
3 changes: 3 additions & 0 deletions Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,9 @@ def to_hash
hash["remote"] = remote
hash["custom_remote"] = custom_remote?
hash["private"] = private?
hash["HEAD"] = git_head || "(none)"
hash["last_commit"] = git_last_commit || "never"
hash["branch"] = git_branch || "(none)"
end

hash
Expand Down

0 comments on commit 54d484d

Please sign in to comment.