def self.changes(io)
vtags = tags.map { |tag| tag[:tag] =~ /\Av/ and tag[:tag] }.sort
cmds = []
if vtags.empty?
cmds << %w(git log)
else
version = vtags[-1]
prev = vtags[vtags.index(version) - 1]
if prev
cmds << [ 'git', 'diff', '--stat', prev, version ]
cmds << [ 'git', 'log', "#{prev}..#{version}" ]
else
cmds << [ 'git', 'log', version ]
end
end
io.sync = true
cmds.each_with_index do |cmd,i|
i > 0 and io.puts
_, status = Process.waitpid2(fork do
if io.fileno != $stdout.fileno
$stdout.reopen(io)
io.close
end
exec(*cmd)
end)
status.success? or abort status.inspect
end
end