aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2017-06-03 10:02:40 +0100
committerMike McQuaid2017-06-03 10:02:40 +0100
commit390bf44f6968b6317bd9f782e7bc80ee778897dd (patch)
tree5a460b728f17c953dde90b5587dc69817a8b2b6b /Library/Homebrew
parent0731a68cde75206682ed972beb47930afa3c434e (diff)
downloadbrew-390bf44f6968b6317bd9f782e7bc80ee778897dd.tar.bz2
missing_formula: note on shallow clones.
This avoids the user confusion on incomplete results seen in http://discourse.brew.sh/t/missing-formula-location/818/7
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/missing_formula.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb
index eac3d7725..75498b128 100644
--- a/Library/Homebrew/missing_formula.rb
+++ b/Library/Homebrew/missing_formula.rb
@@ -126,10 +126,17 @@ module Homebrew
relative_path = path.relative_path_from tap.path
tap.path.cd do
- ohai "Searching for a previously deleted formula..." unless silent
+ unless silent
+ ohai "Searching for a previously deleted formula..."
+ if (tap.path/".git/shallow").exist?
+ opoo <<-EOS.undent
+ #{tap} is shallow clone. To get complete history run:
+ git -C "$(brew --repo #{tap})" fetch --unshallow
+
+ EOS
+ end
+ end
- # We know this may return incomplete results for shallow clones but
- # we don't want to nag everyone with a shallow clone to unshallow it.
log_command = "git log --name-only --max-count=1 --format=%H\\\\n%h\\\\n%B -- #{relative_path}"
hash, short_hash, *commit_message, relative_path =
Utils.popen_read(log_command).gsub("\\n", "\n").lines.map(&:chomp)