Message ID | 20220215115001.18900-1-jdek@itanimul.li |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] tools: add general_assembly.pl | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_aarch64_jetson | success | Make finished |
andriy/make_fate_aarch64_jetson | success | Make fate finished |
andriy/make_armv7_RPi4 | success | Make finished |
andriy/make_fate_armv7_RPi4 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
Hello, On Tue, 15 Feb 2022, at 12:50, J. Dekker wrote: > 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. Why was this rejected? > + foreach my $commit (@commits) { > + if ($commit =~ /\n[\w\/]+\.(c|h|S|asm)/) { > + $true++; > + } Why do we filter on those file types? .md, .pl and other things for docs are active in the community.
On 15/02/2022 17:46, Jean-Baptiste Kempf wrote: > Hello, > > On Tue, 15 Feb 2022, at 12:50, J. Dekker wrote: >> 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. > > Why was this rejected? It was blocked by Nicolas as the procedure to determine the general assembly was not fully decided. >> + foreach my $commit (@commits) { >> + if ($commit =~ /\n[\w\/]+\.(c|h|S|asm)/) { >> + $true++; >> + } > > Why do we filter on those file types? .md, .pl and other things for docs are active in the community. It was just discussed at the in person meeting, our documentation states otherwise and I think we should stick to the documentation here. It doesn't make that much sense to filter out people who have majority documentation commits either--20 documentation commits is still a significant enough contribution. See updated patch.
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); +}
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@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