From a72b3e0c5bd47fefebf0fc4ffb1511aa4468198e Mon Sep 17 00:00:00 2001 From: "George L. Yermulnik" Date: Wed, 1 Apr 2026 15:13:51 +0300 Subject: [PATCH 1/2] fix(brew search): Improve hints for apps migrated within the same tap --- Library/Homebrew/missing_formula.rb | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb index a0074868c5d4f..046ae02512b43 100644 --- a/Library/Homebrew/missing_formula.rb +++ b/Library/Homebrew/missing_formula.rb @@ -108,24 +108,32 @@ def tap_migration_reason(name) new_tap_user, new_tap_repo, new_tap_new_name = new_tap.split("/") new_tap_name = "#{new_tap_user}/#{new_tap_repo}" - message = <<~EOS - It was migrated from #{old_tap} to #{new_tap}. - EOS + same_tap = new_tap == name + + message = if same_tap + "It was migrated from a formula to a cask.\n" + else + "It was migrated from #{old_tap} to #{new_tap}.\n" + end break if new_tap_name == CoreTap.instance.name - install_cmd = if new_tap_name.start_with?("homebrew/cask") + install_cmd = if new_tap_name.start_with?("homebrew/cask") || same_tap "install --cask" else "install" end new_tap_new_name ||= name - message += <<~EOS - You can access it again by running: - brew tap #{new_tap_name} - And then you can install it by running: - brew #{install_cmd} #{new_tap_new_name} - EOS + message += if !same_tap + <<~EOS + You can access it again by running: + brew tap #{new_tap_name} + And then you can install it by running: + EOS + else + "You can install it by running:\n" + end + message += " brew #{install_cmd} #{new_tap_new_name}\n" break end From df9456e11c711efdf81dc36134a9dd8d27833753 Mon Sep 17 00:00:00 2001 From: "George L. Yermulnik" Date: Wed, 1 Apr 2026 15:37:43 +0300 Subject: [PATCH 2/2] Address `brew style` linter suggestion --- Library/Homebrew/missing_formula.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb index 046ae02512b43..ff986ceab81ac 100644 --- a/Library/Homebrew/missing_formula.rb +++ b/Library/Homebrew/missing_formula.rb @@ -124,14 +124,14 @@ def tap_migration_reason(name) end new_tap_new_name ||= name - message += if !same_tap + message += if same_tap + "You can install it by running:\n" + else <<~EOS You can access it again by running: brew tap #{new_tap_name} And then you can install it by running: EOS - else - "You can install it by running:\n" end message += " brew #{install_cmd} #{new_tap_new_name}\n" break