bugspots icon indicating copy to clipboard operation
bugspots copied to clipboard

Add No Merges Option

Open msgerbush opened this issue 14 years ago • 2 comments

Removing merges from the commit history should give more relevant results for a given depth.

Grit allows native git commands, so this can be done by just passing options to rev-list and then parsing the list of commits.

msgerbush avatar Jan 05 '12 18:01 msgerbush

Hmm, do you have some example code for this? Admittedly, not all that familiar with the grit API yet..

igrigorik avatar Jan 07 '12 06:01 igrigorik

I can add this, it is only a few lines. Here is what I have been using

commit_list = g.git.rev_list({:max_count => false, :no_merges => true, :pretty => "raw", :timeout => false}, branch)
commits = Commit.list_from_string(g, commit_list)

In a Grit::Repo there is a git command line interface object called git. The method_missing method, https://github.com/mojombo/grit/blob/master/lib/grit/git.rb#L371, allows you to execute any native git command.

msgerbush avatar Jan 07 '12 17:01 msgerbush