Skip to content

Instantly share code, notes, and snippets.

@gnurag
Created June 3, 2013 14:32
Show Gist options
  • Save gnurag/5698577 to your computer and use it in GitHub Desktop.
Save gnurag/5698577 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
tag1 = ARGV[0]
tag2 = ARGV[1]
cmd=`git log #{tag1}..#{tag2} --pretty='format:%ci::%an <%ae>::%s'`
list = {}
list_order = []
cmd.split("\n").each do |l|
date, author, subject = l.chomp.split("::")
date, time, zone = date.split(" ")
id = "#{date}\t#{author}"
if not list[id]
list[id] = []
list_order << {:id => id, :value => list[id]}
end
list[id] << subject
end
# list.each do |id, value|
list_order.each do |i|
id = i[:id]
value = i[:value]
puts "* #{id}"
puts value.map { |e| "- #{e}" }.join("\n")
puts "\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment