<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>help/status.rdoc</filename>
    </added>
    <added>
      <filename>lib/brigit/commands/status_command.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,12 +2,14 @@ bin/brigit
 help/grab.rdoc
 help/hop.rdoc
 help/map.rdoc
+help/status.rdoc
 help/update.rdoc
 lib/brigit/cli.rb
 lib/brigit/commands/command.rb
 lib/brigit/commands/grab_command.rb
 lib/brigit/commands/hop_command.rb
 lib/brigit/commands/map_command.rb
+lib/brigit/commands/status_command.rb
 lib/brigit/commands/update_command.rb
 lib/brigit/config_parser.rb
 lib/brigit/fallible.rb</diff>
      <filename>Manifest</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,11 @@
 
 A random collection of utilities for developers working with Git repositories.
 
+== Dependencies
+
+* git (&gt;= 1.0.5) by Scott Chacon (sudo gem install git)
+* highline (&gt;= 1.4.0) by James Edward Gray II (sudo gem install highline)
+
 == Contributing
 
 Feel free to fork, send patches, etc.  Development is done at http://github.com/fiveruns/brigit</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -12,4 +12,6 @@ Echoe.new 'brigit' do |p|
   p.url = &quot;http://github.com/fiveruns/brigit&quot;
   p.include_rakefile = true
   p.rcov_options &lt;&lt; '--sort coverage --exclude gems --text-summary'
+  p.runtime_dependencies &lt;&lt; ['git', '&gt;= 1.0.5']
+  p.runtime_dependencies &lt;&lt; ['highline', '&gt;= 1.4.0']  
 end
\ No newline at end of file</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,12 @@
+require 'rubygems'
 require 'find'
 
+gem 'git', '&gt;= 1.0.5'
+require 'git'
+
+gem 'highline', '&gt;= 1.4.0'
+require 'highline/import'
+
 module Brigit
   
   def self.at_dot_gitmodules(base = Dir.pwd)
@@ -44,6 +51,10 @@ module Brigit
       end
     end
   end
+  
+  def self.repo
+    Git.open(Dir.pwd)
+  end
     
 end
 </diff>
      <filename>lib/brigit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@ module Brigit
     
     def say(message)
       message = pretending? ? &quot;{PRETENDING} #{message}&quot; : message
-      $stderr.puts message
+      HighLine.say message
     end
     
     def sh(command)
@@ -65,6 +65,16 @@ module Brigit
       File.directory?(File.join(Dir.pwd, '.git'))
     end
     
+    def submodules_at(path)
+      filename = File.join(path, '.gitmodules')
+      result = config_parser.parse(File.readlines(filename))
+      result.values
+    end
+
+    def config_parser
+      @config_parser ||= ConfigParser.new
+    end
+    
   end
   
 end
\ No newline at end of file</diff>
      <filename>lib/brigit/commands/command.rb</filename>
    </modified>
    <modified>
      <diff>@@ -42,16 +42,6 @@ module Brigit
       result = config_parser.parse(File.readlines(filename))
       result['remote &quot;origin&quot;']['url']
     end
-    
-    def submodules_at(path)
-      filename = File.join(path, '.gitmodules')
-      result = config_parser.parse(File.readlines(filename))
-      result.values
-    end
-
-    def config_parser
-      @config_parser ||= ConfigParser.new
-    end
       
   end
   </diff>
      <filename>lib/brigit/commands/map_command.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,8 +6,21 @@ module Brigit
   class UpdateCommand &lt; Command
         
     def run
-      super
+      pull = false
+      super do
+        parser.on('-p', '--pull', &quot;Pull master repo (if on branch `master')&quot;) do
+          pull = true
+        end
+      end
+      if pull
+        if Brigit.repo.branch.name == 'master'
+          sh &quot;git pull origin master&quot;
+        else
+          say &quot;Not on `master' branch; skipping update of main repo...&quot;
+        end
+      end
       Brigit.at_dot_gitmodules do |path|
+        say &quot;---\nSubmodule: #{path}&quot;
         sh &quot;git submodule init&quot;
         sh &quot;git submodule update&quot;
       end</diff>
      <filename>lib/brigit/commands/update_command.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,13 @@ module Brigit
     module ClassMethods
       
       def [](name)
-        list.detect { |klass| klass.name == name }
+        matching = list.select { |klass| klass.name =~ /^#{Regexp.quote name}/io }
+        return false unless matching.any?
+        if matching.size &gt; 1
+          HighLine.say %|&lt;%= color &quot;Too many matches for `#{name}'&quot;, :red %&gt;|
+          return false
+        end
+        matching.first
       end
 
       def inherited(klass)</diff>
      <filename>lib/brigit/listable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -74,7 +74,7 @@ module Brigit
 
     MAJOR = 0
     MINOR = 9
-    TINY  = 1
+    TINY  = 2
 
     # The current version as a Version instance
     CURRENT = new(MAJOR, MINOR, TINY)</diff>
      <filename>lib/brigit/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,11 +8,11 @@ class CLITest &lt; Test::Unit::TestCase
   context &quot;Brigit::CLI&quot; do
     
     setup do 
-      mock_stderr!
+      mock_streams!
     end
     
     teardown do
-      restore_stderr!
+      restore_streams!
     end
 
     should &quot;parse valid command&quot; do
@@ -26,7 +26,7 @@ class CLITest &lt; Test::Unit::TestCase
       assert_raises SystemExit do
         parse %w(this-does-not-exist)
       end
-      assert !stderr_output.empty?
+      assert !stream_output.empty?
     end
     
     should &quot;have banner with version number&quot; do</diff>
      <filename>test/cli_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,22 +23,22 @@ class CommandTest &lt; Test::Unit::TestCase
     
     context &quot;say instance method&quot; do
       setup do
-        mock_stderr!
+        mock_streams!
       end
       teardown do
-        restore_stderr!
+        restore_streams!
       end
       should &quot;output message&quot; do
         @klass.new.run
-        assert stderr_output.include?('foo')        
-        assert !stderr_output.include?('PRETEND')        
+        assert stream_output.include?('foo')        
+        assert !stream_output.include?('PRETEND')        
       end
       should &quot;mention pretending if doing so&quot; do
         instance = @klass.new
         instance.pretend!
         instance.run
-        assert stderr_output.include?('foo')
-        assert stderr_output.include?('PRETEND')
+        assert stream_output.include?('foo')
+        assert stream_output.include?('PRETEND')
       end
     end
     </diff>
      <filename>test/command_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,11 +8,11 @@ class FallibleTest &lt; Test::Unit::TestCase
     setup do 
       @klass = Class.new
       @klass.send(:include, Brigit::Fallible)
-      mock_stderr!
+      mock_streams!
     end
     
     teardown do
-      restore_stderr!
+      restore_streams!
     end
     
     context &quot;fail method&quot; do
@@ -22,8 +22,8 @@ class FallibleTest &lt; Test::Unit::TestCase
       should &quot;output CLI banner and message&quot; do
         assert_raises SystemExit do
           @klass.new.fail @failed
-          assert stderr_output.include?(Brigit::CLI.banner)
-          assert stderr_output.include?(@failed)
+          assert stream_output.include?(Brigit::CLI.banner)
+          assert stream_output.include?(@failed)
         end
       end
     end</diff>
      <filename>test/fallible_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,11 +5,11 @@ class GrabCommandTest &lt; Test::Unit::TestCase
   context &quot;GrabCommand&quot; do
 
     setup do
-      mock_stderr!
+      mock_streams!
       @command = Brigit::GrabCommand.new
     end
     
-    teardown { restore_stderr! }
+    teardown { restore_streams! }
     
     context &quot;update instance method&quot; do
       setup do
@@ -33,7 +33,7 @@ class GrabCommandTest &lt; Test::Unit::TestCase
           assert_nothing_raised do
             update 'missing_directory'
           end
-          assert stderr_output.include?('skipping')
+          assert stream_output.include?('skipping')
         end
       end
     end</diff>
      <filename>test/grab_command_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,18 +20,23 @@ class Test::Unit::TestCase
     FileUtils.rm_rf File.join(location, '.git') rescue nil
   end
   
-  def mock_stderr!
+  def mock_streams!
+    @old_output = $terminal.instance_variable_get(:@output)
+    $terminal.instance_variable_set(:@output, StringIO.new)
     @old_stderr = $stderr
     $stderr = StringIO.new
   end
   
-  def restore_stderr!
+  def restore_streams!
+    $terminal.instance_variable_set(:@output, @old_output)
     $stderr = @old_stderr
   end
   
-  def stderr_output
+  def stream_output
+    output = $terminal.instance_variable_get(:@output)
+    output.rewind
     $stderr.rewind
-    $stderr.read
+    output.read &lt;&lt; $stderr.read
   end
   
 end
\ No newline at end of file</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4443eefe8aab6d44048d69e9734bac3fbc30ea19</id>
    </parent>
  </parents>
  <author>
    <name>Bruce Williams</name>
    <email>bruce@codefluency.com</email>
  </author>
  <url>http://github.com/fiveruns/brigit/commit/430dd337bb6844e7d496d4e89d6e5f3702c07afd</url>
  <id>430dd337bb6844e7d496d4e89d6e5f3702c07afd</id>
  <committed-date>2008-07-28T17:43:55-07:00</committed-date>
  <authored-date>2008-07-28T17:43:55-07:00</authored-date>
  <message>Add colorized output
Add dependencies: git gem (&gt;= 1.0.5), highline (&gt;= 1.4.0)
Add status command
Add -p option to update command (pull origin master)</message>
  <tree>2e6da8fee775f7c69fc2486537496a235ca6924f</tree>
  <committer>
    <name>Bruce Williams</name>
    <email>bruce@codefluency.com</email>
  </committer>
</commit>
