Skip to content

Instantly share code, notes, and snippets.

@matsubo
Created January 22, 2020 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsubo/7ec60ca3c09cf6c1e8c792e7bda15da0 to your computer and use it in GitHub Desktop.
Save matsubo/7ec60ca3c09cf6c1e8c792e7bda15da0 to your computer and use it in GitHub Desktop.
require 'systemu'
require 'active_support/all'
since = DateTime.new(2019, 6, 1)
while since < Time.now
from = since.strftime('%Y-%m-%d')
to = (since + 1.week - 1.day).strftime('%Y-%m-%d')
git_command = 'git log --all --since="%s" --until="%s" --pretty=format:"%%h,%%an,%%ar,%%s" | wc -l'%[
from,
to,
]
status, stdout, stderr = systemu(git_command)
puts [from, stdout].join("\t")
since = since + 1.week
end
@matsubo
Copy link
Author

matsubo commented Mar 2, 2020

command example

ruby stat.rb |termgraph --color red

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment