anotherjesse (owner)

Fork Of

Revisions

gist: 47337 Download_button fork
public
Description:
log git activity
Public Clone URL: git://gist.github.com/47337.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/ruby
 
require 'rubygems'
require 'git'
 
log = "~/gitlog.txt"
tmp = "/tmp/gitlog"
commit = Git.open('.').log.first
message = [
  commit.date.strftime('%D %H:%M'),
  `pwd`.split(/\//).last.strip,
  commit.message
] * "\t"
 
`touch #{log} && echo "#{message}" | cat - #{log} > #{tmp} && mv #{tmp} #{log}`
 
puts "appended to ~/gitlog.txt" # output helps me make sure post-commit is installed