Skip to content

Instantly share code, notes, and snippets.

@mcansky
Forked from rhaamo/gist:1136841
Created August 14, 2011 15:46
Show Gist options
  • Save mcansky/1145004 to your computer and use it in GitHub Desktop.
Save mcansky/1145004 to your computer and use it in GitHub Desktop.
# encoding: utf-8
require "rubygems"
require "git"
require "ruby-debug" ; Debugger.start
#repo = "/home/marc/src/linux-2.6.38.y"
#repo = "/Users/mcansky/Code/forks/delayed_job"
repo = "/Users/mcansky/Code/grit/linux-2.6"
g = Git.open (repo)
branches = g.branches
commits_count = 30
begin
count=0
foo=0
while (count < commits_count)
commits = g.gtree("master").log(10).skip(count)
commits.each do |c|
useless_commit = [c.sha, c.message, c.author.name, c.date]
doffs_size = g.diff(c.parent, c).count
doffs_tmp = 0
#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
puts foo
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