100% means the person was involved in all the commits, in one way or the
other.

Signed-off-by: Felipe Contreras <felipe.contre...@gmail.com>
---
 contrib/related/git-related    |  2 +-
 contrib/related/test-related.t | 30 +++++++++++++++---------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/contrib/related/git-related b/contrib/related/git-related
index 80e1f17..ffce839 100755
--- a/contrib/related/git-related
+++ b/contrib/related/git-related
@@ -163,5 +163,5 @@ end
 count_per_person.each do |person, count|
   percent = count.to_f * 100 / commits.size
   next if percent < $min_percent
-  puts person
+  puts '%s (involved: %u%%)' % [person, percent]
 end
diff --git a/contrib/related/test-related.t b/contrib/related/test-related.t
index 39b4fe9..ec2680a 100755
--- a/contrib/related/test-related.t
+++ b/contrib/related/test-related.t
@@ -34,8 +34,8 @@ test_expect_success "basic" "
        git format-patch --stdout -1 basic > patch &&
        git related patch | sort > actual &&
        cat > expected <<-EOF &&
-       Jon Stewart <j...@stewart.com>
-       Pablo Escobar <pa...@escobar.com>
+       Jon Stewart <j...@stewart.com> (involved: 50%)
+       Pablo Escobar <pa...@escobar.com> (involved: 50%)
        EOF
        test_cmp expected actual
 "
@@ -44,9 +44,9 @@ test_expect_success "others" "
        git format-patch --stdout -1 master > patch &&
        git related patch | sort > actual &&
        cat > expected <<-EOF &&
-       John Doe <j...@doe.com>
-       John Poppins <j...@doe.com>
-       Jon Stewart <j...@stewart.com>
+       John Doe <j...@doe.com> (involved: 33%)
+       John Poppins <j...@doe.com> (involved: 33%)
+       Jon Stewart <j...@stewart.com> (involved: 66%)
        EOF
        test_cmp expected actual
 "
@@ -56,10 +56,10 @@ test_expect_success "multiple patches" "
        git format-patch --stdout -1 master^ > patch2 &&
        git related patch1 patch2 | sort > actual &&
        cat > expected <<-EOF &&
-       John Doe <j...@doe.com>
-       John Poppins <j...@doe.com>
-       Jon Stewart <j...@stewart.com>
-       Pablo Escobar <pa...@escobar.com>
+       John Doe <j...@doe.com> (involved: 25%)
+       John Poppins <j...@doe.com> (involved: 25%)
+       Jon Stewart <j...@stewart.com> (involved: 50%)
+       Pablo Escobar <pa...@escobar.com> (involved: 25%)
        EOF
        test_cmp expected actual
 "
@@ -67,9 +67,9 @@ test_expect_success "multiple patches" "
 test_expect_success "from committish" "
        git related -1 master | sort > actual &&
        cat > expected <<-EOF &&
-       John Doe <j...@doe.com>
-       John Poppins <j...@doe.com>
-       Jon Stewart <j...@stewart.com>
+       John Doe <j...@doe.com> (involved: 33%)
+       John Poppins <j...@doe.com> (involved: 33%)
+       Jon Stewart <j...@stewart.com> (involved: 66%)
        EOF
        test_cmp expected actual
 "
@@ -77,9 +77,9 @@ test_expect_success "from committish" "
 test_expect_success "from single rev committish" "
        git related -1 master | sort > actual &&
        cat > expected <<-EOF &&
-       John Doe <j...@doe.com>
-       John Poppins <j...@doe.com>
-       Jon Stewart <j...@stewart.com>
+       John Doe <j...@doe.com> (involved: 33%)
+       John Poppins <j...@doe.com> (involved: 33%)
+       Jon Stewart <j...@stewart.com> (involved: 66%)
        EOF
        test_cmp expected actual
 "
-- 
1.8.4-fc

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to