[FFmpeg-devel] [PATCH] tools: add general_assembly.pl

J. Dekker jdek at itanimul.li
Tue Feb 15 13:50:01 EET 2022


This script generates the current general assembly voters according to
the criteria of '20 code commits in the last 36 months'.

Signed-off-by: J. Dekker <jdek at itanimul.li>
---

 This was rejected last time but I would really like to get this in the
 tools or at least publicly recorded on mailing list since the script
 was updated.

 tools/general_assembly.pl | 45 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 tools/general_assembly.pl

diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl
new file mode 100644
index 0000000000..c3aea14d79
--- /dev/null
+++ b/tools/general_assembly.pl
@@ -0,0 +1,45 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+use POSIX qw(strftime);
+use Encode qw(decode);
+use Data::Dumper;
+
+sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
+
+my @shortlog = split /\n/, decode('UTF-8', `git log --pretty=format:"%aN <%aE>" --since="last 36 months" | sort | uniq -c | sort -r`, Encode::FB_CROAK);
+my %assembly = ();
+
+foreach my $line (@shortlog) {
+    my ($count, $name, $email) = $line =~ m/^ *(\d+) *(.*?) <(.*?)>/;
+
+    if ($count < 20) {
+        next;
+    }
+
+    $name = trim $name;
+
+    # assume people with 50 commits have at least 20 source commits
+    if ($count < 50) {
+        my $true = 0;
+        my @commits = split /(^|\n)commit [a-z0-9]{40}(\n|$)/, decode('UTF-8', `git log --name-only --use-mailmap --author="$email" --since="last 36 months"`, Encode::FB_CROAK);
+        foreach my $commit (@commits) {
+            if ($commit =~ /\n[\w\/]+\.(c|h|S|asm)/) {
+                $true++;
+            }
+        }
+
+        if ($true < 20) {
+            next;
+        }
+    }
+
+    $assembly{$name} = $email;
+}
+
+printf("# %s %s", strftime("%Y-%m-%d", localtime), decode('UTF-8', `git rev-parse HEAD`, Encode::FB_CROAK));
+foreach my $email (sort values %assembly) {
+    printf("%s\n", $email);
+}
-- 
2.32.0 (Apple Git-132)



More information about the ffmpeg-devel mailing list