Ruby git变更日志
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ruby git变更日志相关的知识,希望对你有一定的参考价值。
Generates a ChangeLog from git repository.
#!/usr/bin/env ruby cmd=`git-log --pretty='format:%ci::%an <%ae>::%s'` list = {} list_order = [] cmd.each do |l| date, author, subject = l.chomp.split("::") date, time, zone = date.split(" ") id = "#{date} #{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(" ") puts " " end
以上是关于Ruby git变更日志的主要内容,如果未能解决你的问题,请参考以下文章