[PATCH v10 06/15] contrib: related: print the amount of involvement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 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 <jon@xxxxxxxxxxx>
-	Pablo Escobar <pablo@xxxxxxxxxxx>
+	Jon Stewart <jon@xxxxxxxxxxx> (involved: 50%)
+	Pablo Escobar <pablo@xxxxxxxxxxx> (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 <john@xxxxxxx>
-	John Poppins <john@xxxxxxx>
-	Jon Stewart <jon@xxxxxxxxxxx>
+	John Doe <john@xxxxxxx> (involved: 33%)
+	John Poppins <john@xxxxxxx> (involved: 33%)
+	Jon Stewart <jon@xxxxxxxxxxx> (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 <john@xxxxxxx>
-	John Poppins <john@xxxxxxx>
-	Jon Stewart <jon@xxxxxxxxxxx>
-	Pablo Escobar <pablo@xxxxxxxxxxx>
+	John Doe <john@xxxxxxx> (involved: 25%)
+	John Poppins <john@xxxxxxx> (involved: 25%)
+	Jon Stewart <jon@xxxxxxxxxxx> (involved: 50%)
+	Pablo Escobar <pablo@xxxxxxxxxxx> (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 <john@xxxxxxx>
-	John Poppins <john@xxxxxxx>
-	Jon Stewart <jon@xxxxxxxxxxx>
+	John Doe <john@xxxxxxx> (involved: 33%)
+	John Poppins <john@xxxxxxx> (involved: 33%)
+	Jon Stewart <jon@xxxxxxxxxxx> (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 <john@xxxxxxx>
-	John Poppins <john@xxxxxxx>
-	Jon Stewart <jon@xxxxxxxxxxx>
+	John Doe <john@xxxxxxx> (involved: 33%)
+	John Poppins <john@xxxxxxx> (involved: 33%)
+	Jon Stewart <jon@xxxxxxxxxxx> (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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]