diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 34db5a9e47..5e0554dbb6 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -20,7 +20,9 @@ module Homebrew tapd = HOMEBREW_LIBRARY/"Taps/#{user.downcase}/homebrew-#{repo.downcase}" return false if tapd.directory? ohai "Tapping #{repouser}/#{repo}" - abort unless system "git", "clone", "https://github.com/#{repouser}/homebrew-#{repo}", tapd.to_s + args = %W[clone https://github.com/#{repouser}/homebrew-#{repo} #{tapd}] + args << "--depth=1" unless ARGV.include?("--full") + safe_system "git", *args files = [] tapd.find_formula { |file| files << file } @@ -109,7 +111,7 @@ module Homebrew end end - def tap_args(tap_name=ARGV.first) + def tap_args(tap_name=ARGV.named.first) tap_name =~ HOMEBREW_TAP_ARGS_REGEX raise "Invalid tap name" unless $1 && $3 [$1, $3] diff --git a/Library/Homebrew/manpages/brew.1.md b/Library/Homebrew/manpages/brew.1.md index c7a2206a46..d223735173 100644 --- a/Library/Homebrew/manpages/brew.1.md +++ b/Library/Homebrew/manpages/brew.1.md @@ -345,11 +345,13 @@ Note that these flags should only appear after a command. * `switch` : Symlink all of the specific of 's install to Homebrew prefix. - * `tap` []: + * `tap` [--full] []: Tap a new formula repository from GitHub, or list existing taps. is of the form /, e.g. `brew tap homebrew/dupes`. + If `--full` is passed, a full clone will be used. + * `tap --repair`: Ensure all tapped formulae are symlinked into Library/Formula and prune dead formulae from Library/Formula. diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1 index 4997ce171b..08c54d0cdd 100644 --- a/share/man/man1/brew.1 +++ b/share/man/man1/brew.1 @@ -369,12 +369,15 @@ Instantiate a Homebrew build environment\. Uses our years\-battle\-hardened Home Symlink all of the specific \fIversion\fR of \fIname\fR\'s install to Homebrew prefix\. . .TP -\fBtap\fR [\fItap\fR] +\fBtap\fR [\-\-full] [\fItap\fR] Tap a new formula repository from GitHub, or list existing taps\. . .IP \fItap\fR is of the form \fIuser\fR/\fIrepo\fR, e\.g\. \fBbrew tap homebrew/dupes\fR\. . +.IP +If \fB\-\-full\fR is passed, a full clone will be used\. +. .TP \fBtap \-\-repair\fR Ensure all tapped formulae are symlinked into Library/Formula and prune dead formulae from Library/Formula\.