3 # This is a command line client that can do a number of read operations
4 # on a git repository in pure ruby. This may be helpful if you have access
5 # to a computer that has no C compiler but you want to do some git stuff
6 # on it. It's also helpful for me to test Git stuff with.
8 # author : Scott Chacon (schacon@gmail.com)
23 puts
'You have to provide a command'
24 puts
'usage: gitr (command) [args]'
35 git_dir
= ENV['GIT_DIR'] || '.git'
36 @git = Git
.bare(git_dir
, :log => Logger
.new(STDOUT))
42 puts
'commit ' + l
.sha
51 puts
@git.cat_file(ARGV[1])
54 puts
@git.revparse(ARGV[1])
60 @git.config
.sort
.each
do |k
,v
|