Skip to content

Instantly share code, notes, and snippets.

@rhaamo
Created June 10, 2011 18:33
Show Gist options
  • Save rhaamo/1019440 to your computer and use it in GitHub Desktop.
Save rhaamo/1019440 to your computer and use it in GitHub Desktop.
# coding: utf-8
require "rubygems"
require "grit"
require "ruby-debug" ; Debugger.start
include Grit
Grit::Git.git_timeout = 300 # 5.minutes
Grit::Git.git_max_size = 41943040 # 40.megabytes
Grit.debug = true
repo = "/home/marc/src/linux-2.6.38.y"
grit_repo = Repo.new(repo)
branches = grit_repo.branches
commits_count = grit_repo.commit_count("master")
begin
count=0
foo=0
while (count < commits_count)
commits = grit_repo.commits("master", 10, count)
commits.each do |c|
useless_commit = [c.id, c.message, c.author.name, c.committed_date]
c.diffs.each do |diff|
a_file = nil
a_file = [diff.b_path.split("/").last, diff.b_path]
end
end
diff_c = commits_count - count
if (diff_c > 10)
count += 10
else
count += diff_c
end
foo+=1
end
rescue Grit::Git::GitTimeout => e
puts e
puts "Repository: #{repo}"
puts "Branches: #{branches}"
puts "Commits: #{commits_count}"
puts "Foo: #{foo}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment