Skip to content

Instantly share code, notes, and snippets.

@mzp
Created October 11, 2009 12:26
Show Gist options
  • Save mzp/207650 to your computer and use it in GitHub Desktop.
Save mzp/207650 to your computer and use it in GitHub Desktop.
git blog: generate blog template from git repository
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# git blog: generate blog template from git repository
#
# Usage:
# $ git blog > diary.txt
#
# and upload diary.txt by some methods.
#
commits = %x(git log --pretty=oneline --since=1.day).map do|line|
line.split(' ',2)
end.reverse
today = Time.now
# format
github = commits.map do|rev,msg|
"|[http://github.com/mzp/scheme-abc/commit/#{rev}:title=#{rev}]|#{msg.chop}\
|\n"
end
# print
puts <<END
#{today.strftime "%Y-%m-%d:"}
*log*[進捗]本日の作業履歴
** 要約
______
** 本日のコミット
#{github}
END
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment