diff options
| author | Adam Vandenberg | 2011-05-12 08:47:51 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2011-05-12 08:47:51 -0700 |
| commit | bebe5af9c4454369d0692eb49cb69ec91038076b (patch) | |
| tree | 651e7172efb775fb603b6e8bf135d77d963c6f48 /Library | |
| parent | d18978d6fddb7fb045676492a2d867e5a05cead6 (diff) | |
| download | homebrew-bebe5af9c4454369d0692eb49cb69ec91038076b.tar.bz2 | |
brew doctor: find suspicious git newline configs
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 526747b57..c9a62111b 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -538,13 +538,35 @@ def check_for_git Homebrew uses Git for several internal functions, and some formulae use Git checkouts instead of stable tarballs. - You may want to do: + You may want to install git: brew install git EOS end end +def check_git_newline_settings + git = `/usr/bin/which git`.chomp + return if git.empty? + + autocrlf=`git config --get core.autocrlf` + safecrlf=`git config --get core.safecrlf` + + if autocrlf=='input' and safecrlf=='true' + puts <<-EOS.undent + Suspicious Git newline settings found. + + The detected Git newline settings can cause checkout problems: + core.autocrlf=#{autocrlf} + core.safecrlf=#{safecrlf} + + If you are not routinely dealing with Windows-based projects, + consider removing these settings. + + EOS + end +end + def check_for_autoconf which_autoconf = `/usr/bin/which autoconf`.chomp unless (which_autoconf == '/usr/bin/autoconf' or which_autoconf == '/Developer/usr/bin/autoconf') @@ -709,6 +731,7 @@ module Homebrew extend self check_for_symlinked_cellar check_for_multiple_volumes check_for_git + check_git_newline_settings check_for_autoconf check_for_linked_kegonly_brews check_for_other_frameworks |
