Skip to content

Instantly share code, notes, and snippets.

@linyows
Created January 9, 2013 06:45
Show Gist options
  • Save linyows/4491159 to your computer and use it in GitHub Desktop.
Save linyows/4491159 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
remote = `git remote -v | grep origin | awk '{print $2}'`.
split("\n").first.chomp.
sub(/.*:(.*)/, '\1').sub(/\.git/, '')
log = `git log --after=yesterday --author='linyows'`
#log = `git log --author='linyows'`
commits = {}
count = 0
log.each_line do |line|
commit = line.match(/commit (\w+)/)
if commit
count += 1
commits[count] = {}
commits[count]['number'] = commit[1]
commits[count]['message'] = []
next
end
comment = line.match(/\s{4}(.*)/)
if comment
commits[count]['message'] << comment[1]
end
end
commits.each do |number, commit|
commit['message'].each_with_index do |l, i|
if i.zero?
puts "- #{l} "
else
puts " #{l} "
end
end
puts " [https://github.com/#{remote}/commit/#{commit['number']}](https://github.com/#{remote}/commit/#{commit['number']})"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment