[PATCH v5 03/15] contrib: related: sort by amount of involvement

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

 



Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 contrib/related/git-related | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/contrib/related/git-related b/contrib/related/git-related
index 6f18cc8..8c26cf8 100755
--- a/contrib/related/git-related
+++ b/contrib/related/git-related
@@ -134,7 +134,12 @@ commits.each do |id, commit|
   end
 end
 
-count_per_person.each do |person, count|
+# sort by number of participations
+count_sort = lambda do |a, b|
+  b[1] <=> a[1]
+end
+
+count_per_person.sort(&count_sort).each do |person, count|
   percent = count.to_f * 100 / commits.size
   next if percent < $min_percent
   puts person
-- 
1.8.3.rc2.542.g24820ba

--
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]