aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/git.rb
diff options
context:
space:
mode:
authorDave Goodell2013-03-01 22:54:13 -0600
committerMike McQuaid2013-03-02 08:53:11 +0000
commitb726c77189753138a321d8d8aba4dfb5cc3ed7d1 (patch)
tree931b763745c4e35892ad05a604cfad4a5b23db4e /Library/Formula/git.rb
parent8c3eaa38173961f3c9362a9c6a09012d1ec8618a (diff)
downloadhomebrew-b726c77189753138a321d8d8aba4dfb5cc3ed7d1.tar.bz2
git: add `--without-completions` option
Some users prefer the `_git` script included with the zsh distribution instead of the one based on the bash completion script. References #16992. Closes #18180. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/git.rb')
-rw-r--r--Library/Formula/git.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/Library/Formula/git.rb b/Library/Formula/git.rb
index 2818a3009..e58027913 100644
--- a/Library/Formula/git.rb
+++ b/Library/Formula/git.rb
@@ -18,6 +18,7 @@ class Git < Formula
head 'https://github.com/git/git.git'
option 'with-blk-sha1', 'Compile with the block-optimized SHA1 implementation'
+ option 'without-completions', 'Disable bash/zsh completions from "contrib" directory'
depends_on 'pcre' => :optional
@@ -64,12 +65,14 @@ class Git < Formula
bin.install 'git-subtree'
end
- # install the completion script first because it is inside 'contrib'
- bash_completion.install 'contrib/completion/git-completion.bash'
- bash_completion.install 'contrib/completion/git-prompt.sh'
+ unless build.include? 'without-completions'
+ # install the completion script first because it is inside 'contrib'
+ bash_completion.install 'contrib/completion/git-completion.bash'
+ bash_completion.install 'contrib/completion/git-prompt.sh'
- zsh_completion.install 'contrib/completion/git-completion.zsh' => '_git'
- cp "#{bash_completion}/git-completion.bash", zsh_completion
+ zsh_completion.install 'contrib/completion/git-completion.zsh' => '_git'
+ cp "#{bash_completion}/git-completion.bash", zsh_completion
+ end
(share+'git-core').install 'contrib'