Hide main branches from brew tap-info and brew info

These are basically as "default" as `master` now so we can hide them.
This commit is contained in:
Mike McQuaid 2025-06-13 12:09:02 +01:00
parent 29e7229463
commit af997ea2ad
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View File

@ -63,6 +63,8 @@ module Homebrew
puts info puts info
else else
info = "" info = ""
default_branches = %w[main master].freeze
taps.each_with_index do |tap, i| taps.each_with_index do |tap, i|
puts unless i.zero? puts unless i.zero?
info = "#{tap}: " info = "#{tap}: "
@ -79,7 +81,7 @@ module Homebrew
info += "\norigin: #{tap.remote}" if tap.remote != tap.default_remote info += "\norigin: #{tap.remote}" if tap.remote != tap.default_remote
info += "\nHEAD: #{tap.git_head || "(none)"}" info += "\nHEAD: #{tap.git_head || "(none)"}"
info += "\nlast commit: #{tap.git_last_commit || "never"}" info += "\nlast commit: #{tap.git_last_commit || "never"}"
info += "\nbranch: #{tap.git_branch || "(none)"}" if tap.git_branch != "master" info += "\nbranch: #{tap.git_branch || "(none)"}" if default_branches.exclude?(tap.git_branch)
else else
info += "Not installed" info += "Not installed"
end end

View File

@ -128,7 +128,8 @@ module SystemConfig
out.puts "#{tap_name} origin: #{tap.remote}" if tap.remote != tap.default_remote out.puts "#{tap_name} origin: #{tap.remote}" if tap.remote != tap.default_remote
out.puts "#{tap_name} HEAD: #{tap.git_head || "(none)"}" out.puts "#{tap_name} HEAD: #{tap.git_head || "(none)"}"
out.puts "#{tap_name} last commit: #{tap.git_last_commit || "never"}" out.puts "#{tap_name} last commit: #{tap.git_last_commit || "never"}"
out.puts "#{tap_name} branch: #{tap.git_branch || "(none)"}" if tap.git_branch != "master" default_branches = %w[main master].freeze
out.puts "#{tap_name} branch: #{tap.git_branch || "(none)"}" if default_branches.exclude?(tap.git_branch)
end end
if (json_file = Homebrew::API::HOMEBREW_CACHE_API/json_file_name) && json_file.exist? if (json_file = Homebrew::API::HOMEBREW_CACHE_API/json_file_name) && json_file.exist?