Skip to content

Instantly share code, notes, and snippets.

@joker1007
Created August 1, 2012 04:44
Show Gist options
  • Save joker1007/3223737 to your computer and use it in GitHub Desktop.
Save joker1007/3223737 to your computer and use it in GitHub Desktop.
その日のコミットログの最初と最後を表示する
#!/bin/env ruby
require 'time'
require 'pp'
AUTHOR = "joker1007"
COMMAND = "/usr/bin/git log --author=#{AUTHOR} --all --pretty='%ci'"
timestamps = `#{COMMAND}`.each_line.map do |l|
Time.parse(l.chomp)
end
pp timestamps.group_by {|t|
t.strftime("%Y/%m/%d")
}.each_with_object({}) {|kv, h|
h[kv[0]] = kv[1].minmax
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment