Created
February 1, 2010 00:38
-
-
Save sandofsky/291343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'grit' | |
require 'active_support' | |
include Grit | |
merged_branches = `git branch -a --merged`.split("\n").collect(&:strip) - ["* master"] | |
repo = Repo.new(ARGV[0]) | |
merged_branches.each do |branch| | |
begin | |
last_commit = repo.commits(branch).first | |
last_time = Time.parse last_commit.to_hash['committed_date'] | |
committer = last_commit.to_hash['committer'] | |
if last_time < 30.days.ago | |
puts "#{branch.sub("remotes/origin/", "")}:\t#{last_time.strftime("%m/%d/%Y")}\t#{committer['name']} #{committer['email']}" | |
end | |
rescue | |
puts "Failure on branch: #{branch}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment