From 54b5a7afbb7d562c3ee3adf607d6067cd6b7d2dc Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 7 Apr 2010 16:45:31 -0700 Subject: [PATCH] Add --git option to 'brew install -i'. This allows for easy generation of diffs, per a trick in http://wiki.github.com/mxcl/homebrew/formula-cookbook --- Library/Homebrew/install.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index e16e4dd77d..8a6836bd17 100755 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -78,6 +78,15 @@ def install f ohai "Entering interactive mode" puts "Type `exit' to return and finalize the installation" puts "Install to this prefix: #{f.prefix}" + + if ARGV.flag? '--git' + system "git init" + system "git add -A" + puts "This folder is now a git repo. Make your changes and then use:" + puts " git diff | pbcopy" + puts "to copy the diff to the clipboard." + end + interactive_shell nil elsif ARGV.include? '--help'