brew-log: warn if shallow clone
Closes Homebrew/homebrew#46283. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
cd267e0bce
commit
e8c8b876af
@ -4,11 +4,25 @@ module Homebrew
|
|||||||
def log
|
def log
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
cd HOMEBREW_REPOSITORY
|
cd HOMEBREW_REPOSITORY
|
||||||
exec "git", "log", *ARGV.options_only
|
git_log
|
||||||
else
|
else
|
||||||
path = Formulary.path(ARGV.named.first)
|
path = Formulary.path(ARGV.named.first)
|
||||||
cd path.dirname # supports taps
|
cd path.dirname # supports taps
|
||||||
exec "git", "log", *ARGV.options_only + ["--", path]
|
git_log path
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user