From b33dba722ddf728f877e536a7308f5ad33972c26 Mon Sep 17 00:00:00 2001 From: William Morgan Date: Sat, 24 May 2008 21:43:53 -0700 Subject: [PATCH] bugfix: git-rank-contributor not counting quite right --- bin/git-rank-contributors | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/git-rank-contributors b/bin/git-rank-contributors index f667f36..db213aa 100755 --- a/bin/git-rank-contributors +++ b/bin/git-rank-contributors @@ -27,20 +27,20 @@ class String end lines = {} -state = :pre_author -author = nil verbose = ARGV.delete("-v") obfuscate = ARGV.delete("-o") -`git log -p`.each do |l| +author = nil +state = :pre_author +`git log -p --no-color`.each do |l| case - when state == :pre_author && l =~ /Author: (.*)$/ + when (state == :pre_author || state == :post_author) && l =~ /Author: (.*)$/ author = $1 state = :post_author lines[author] ||= 0 when state == :post_author && l =~ /^\+\+\+/ state = :in_diff - when state == :in_diff && l =~ /^[\+\-] / + when state == :in_diff && l =~ /^[\+\-]/ lines[author] += 1 when state == :in_diff && l =~ /^commit / state = :pre_author -- 2.11.4.GIT