[FFmpeg-devel] [PATCH] Add general_assembly_bootstrap.pl
Josh de Kock
josh at itanimul.li
Fri Apr 24 13:22:32 EEST 2020
This script aims to extract contributors who are eligible for the
general assembly.
Signed-off-by: Josh de Kock <josh at itanimul.li>
---
Better late than never, this patch will continue to put in place the
voting systems for FFmpeg discussed at VDD 2019 and FOSDEM 2020.
There is probably a better way to do this, but the aim is just to
'bootstrap' and kickstart the process and commitees.
tools/general_assembly_bootstrap.pl | 48 +++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100755 tools/general_assembly_bootstrap.pl
diff --git a/tools/general_assembly_bootstrap.pl b/tools/general_assembly_bootstrap.pl
new file mode 100755
index 0000000000..320fe76992
--- /dev/null
+++ b/tools/general_assembly_bootstrap.pl
@@ -0,0 +1,48 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+use Encode qw(decode);
+use List::MoreUtils qw(uniq);
+# cpan List::MoreUtils
+use JSON::MaybeXS;
+# cpan JSON::MaybeXS
+
+use Data::Dumper;
+
+sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
+
+my @shortlog = split /\n/, decode('UTF-8', `git shortlog -sne --since="last 36 months"`, Encode::FB_CROAK);
+
+my %assembly = ();
+
+foreach my $line (@shortlog) {
+ my ($count, $name, $email) = $line =~ m/^ *(\d+) *(.*?) <(.*?)>/;
+
+ if ($count < 20) {
+ next;
+ }
+
+ # make sure name is trimmed
+ $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;
+}
+
+print encode_json(\%assembly);
--
2.24.1 (Apple Git-126)
More information about the ffmpeg-devel
mailing list