Articles tagged with: git

Recursive git: rgit

Posted by Andreas on Thursday, October 30, 2008 at 03:24 (CET)

Here’s a little helper that runs a git command on every repository found in subdirs. Put the following ruby code into a file called rgit, make it executable and save it to a bin directory, like /usr/local/bin:

 1 #!/usr/bin/env ruby
 2 if ARGV.empty?
 3   STDERR.puts "usage: #{File.basename($0)} <cmd> ..."
 4   STDERR.puts "  Runs git <cmd> in every repository found in subdirs"
 5   exit
 6 end
 7 dirs = Dir.glob('**/.git').map { |d| d.chomp('/.git') }
 8 dirs.each do |dir|
 9   puts "-> #{dir}"
10   Dir.chdir(dir) do
11     system 'git', *ARGV
12   end
13 end

I’m using rgit pull or rgit fetch every morning to retrieve the latest code changes and rgit push every evening to make sure all my changes get pushed to the server. rgit repack -a -d is useful to cleanup all local repositories.

Todo: git submodules should be filtered out. Currently, they are processed like normal repositories, which probably is not what you want.

Rails moves to GIT - no more SVN?

Posted by Andreas on Thursday, April 03, 2008 at 07:00 (CEST)

Yesterday, in my post about upcoming features in Rails 2.1, I wrote, that Git gets more and more attention in the Ruby on Rails scene recently – and this morning, I stumbled across a post from David, where he annonced, that Ruby on Rails itself is moving from Svn to Git.

That was a rather welcome news to me, since I personally use Git for quite some time now and have switched all my repositories to Git a while ago. However, some people seem to be concerned about Svn being dropped by Rails. But it’s not as bad as you may think, since this doesn’t mean that you have to move to Git as well…

Read more »

My favorite features in upcoming Rails 2.1

Posted by Andreas on Wednesday, April 02, 2008 at 04:52 (CEST)

Ruby on Rails 2.1 is almost here and there are several interesting features coming with it. Among many little details, performance optimizations and some bug fixes, my favorites are:

  • ActiveRecord named scopes
  • ActiveRecord dirty field checking and partial updates
  • Built-in gem dependencies
Read more »