Skip to content

Instantly share code, notes, and snippets.

@vrinek
Created October 24, 2011 09:07
Show Gist options
  • Save vrinek/1308633 to your computer and use it in GitHub Desktop.
Save vrinek/1308633 to your computer and use it in GitHub Desktop.
ruby ../cleanup_gist/merged_branches.rb > ../cleanup_gist/table.txt && cat ../cleanup_gist/table.txt
require 'rubygems'
require 'hirb'
cmd = "git branch --color=never -a --merged | grep --color=never origin/ | xargs -n1 git log -1 --decorate --pretty=format:'%d|%aN|%ar|%s%n' |sort -t'|' --key=2,2"
br = `#{cmd}`.split("\n").reject{|b| b =~ /HEAD/}
br = br.sort.map{|b| b.strip.split "|"}
puts Hirb::Helpers::Table.render br, :max_width => 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment