Project

General

Profile

Download (850 Bytes) Statistics
| Branch: | Tag: | Revision:
d3bb1f6b Ohad Levy
#!/usr/bin/env ruby

9d43fc71 Michael Moll
cmd = `git log --pretty='format:%ci::%an <%ae>::%s'`
d3bb1f6b Ohad Levy
list = {}
list_order = []
contributors = []
changelog_file = "CHANGELOG"
contributors_file = "Contributors"

97c68d82 Dominic Cleal
cmd.each_line do |l|
d3bb1f6b Ohad Levy
date, author, subject = l.chomp.split("::")
2312cccf Daniel Lobato
date, _time, _zone = date.split(" ")
d3bb1f6b Ohad Levy
id = "#{date}\t#{author}"
7e880437 Michael Moll
unless (list[id])
d3bb1f6b Ohad Levy
list[id] = []
list_order << {:id => id, :value => list[id]}
end
list[id] << subject
contributors << author
end

# list.each do |id, value|
f4459c11 David Davis
file = File.new(changelog_file, "w")
d3bb1f6b Ohad Levy
list_order.each do |i|
id = i[:id]
value = i[:value]

f4459c11 David Davis
file.puts id.to_s
d3bb1f6b Ohad Levy
file.puts value.map { |e| "\t* #{e}" }.join("\n")
file.puts "\n"
end
file.close
f4459c11 David Davis
file = File.new(contributors_file, "w")
d3bb1f6b Ohad Levy
file.puts "Contributors (sorted alphabetically)"
file.puts "\n"
57efe613 Tomer Brisker
file.puts contributors.uniq.sort.join("\n")
d3bb1f6b Ohad Levy
file.close