Skip to content
Snippets Groups Projects
Commit e8c8b876 authored by Baptiste Fontaine's avatar Baptiste Fontaine
Browse files

brew-log: warn if shallow clone


Closes Homebrew/homebrew#46283.

Signed-off-by: default avatarBaptiste Fontaine <batifon@yahoo.fr>
parent cd267e0b
No related branches found
No related tags found
No related merge requests found
......@@ -4,11 +4,25 @@ module Homebrew
def log
if ARGV.named.empty?
cd HOMEBREW_REPOSITORY
exec "git", "log", *ARGV.options_only
git_log
else
path = Formulary.path(ARGV.named.first)
cd path.dirname # supports taps
exec "git", "log", *ARGV.options_only + ["--", path]
git_log path
end
end
private
def git_log(path=nil)
if File.exist? "#{`git rev-parse --show-toplevel`.chomp}/.git/shallow"
opoo <<-EOS.undent
The git repository is a shallow clone therefore the filtering may be incorrect.
Use `git fetch --unshallow` to get the full repository.
EOS
end
args = ARGV.options_only
args += ["--", path] unless path.nil?
exec "git", "log", *args
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment