Skip to content

Instantly share code, notes, and snippets.

@sandofsky
Created February 1, 2010 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandofsky/291343 to your computer and use it in GitHub Desktop.
Save sandofsky/291343 to your computer and use it in GitHub Desktop.
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