Created
November 21, 2011 04:31
-
-
Save benhoskings/1381621 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rb-fsevent' | |
LOG_CMD = 'git log --all --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset"' | |
abort("Run with a single argument (the directory to omglog).") unless ARGV.length == 1 | |
FSEvent.new.tap {|fsevent| | |
lines = (`tput lines`.to_i * 0.8).floor | |
fsevent.watch(File.join(ARGV[0], '.git')) {|directories| | |
`#{LOG_CMD} -#{lines}`.tap {|log| | |
STDOUT.puts "\033[2J" + log | |
} | |
} | |
fsevent.run | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment