Paste Description for Git
requires FasterCSV, run in your source directory
- Git
- 2007年 11月 27日 火曜日 20:40:11 MDT
- require 'fastercsv'
- h = Hash.new
- linen = 0
- dategroup = Date.new
- #.select{ |l| l =~ /[a-zA-Z0-9]+/ }
- `git log --pretty=format:%aD --shortstat | grep [a-zA-Z0-9]`.each { |line|
- if line =~ /\d\d:\d\d:\d\d/ then
- date = Date.parse(line)
- dategroup = Date.new(date.year, date.month, 1)
- if h[dategroup] then
- h[dategroup][:commits] += 1
- else
- h[dategroup] = Hash.new
- h[dategroup][:commits] = 1
- end
- else
- line =~ /([\d]+) files changed, ([\d]+) insertions\(\+\), ([\d]+) deletions\(-\)/
- h[dategroup][:insert] = (h[dategroup][:insert])? h[dategroup][:insert].to_i + $2.to_i : $2.to_i
- h[dategroup][:delete] = (h[dategroup][:delete])? h[dategroup][:delete].to_i + $3.to_i : $3.to_i
- end
- }
- FasterCSV.open("/tmp/count.csv", "w") do |csv|
- h.sort.each { |date, value|
- csv << [ "#{date.month}/1/#{date.year}", value[:commits], value[:insert] + value[:delete] ]
- }
- end
advertising
ポストを更新
このポストは更新できる、または、新しいポストを作成。
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.