Skip to content

Instantly share code, notes, and snippets.

@GregPK
Created November 22, 2018 12:50
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 GregPK/1637c74e38996d4dc937ad9cfdc43b76 to your computer and use it in GitHub Desktop.
Save GregPK/1637c74e38996d4dc937ad9cfdc43b76 to your computer and use it in GitHub Desktop.
past_dweller
require 'date'
MONTHS = 18
CMD = 'git log --pretty="%an %ae%n%cn %ce" -- graphql_api | sort | uniq | wc -l'
# cloc . | grep Ruby
results = []
MONTHS.times do |i|
date = (DateTime.now - (i*30)).strftime("%Y-%m-%d")
`git checkout \`git rev-list -n 1 --before="#{date} 00:00" master\` > /dev/null 2>&1`
results << date + ',' + `#{cmd}`
end
results.reverse.each do |res|
puts res
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment