From patchwork Wed Nov 15 10:19:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 44670 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:92a5:b0:181:818d:5e7f with SMTP id q37csp2583877pzg; Wed, 15 Nov 2023 02:20:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGe2ioX6dO4LasScUniB81eHBjD+m9RN1o1BgM7f9LnggGEop7KDV7GXkOvffeUc385y+l0 X-Received: by 2002:aa7:c056:0:b0:543:56c8:f84b with SMTP id k22-20020aa7c056000000b0054356c8f84bmr8608900edo.19.1700043651445; Wed, 15 Nov 2023 02:20:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700043651; cv=none; d=google.com; s=arc-20160816; b=rs++7bOgnlahMbABo8P2xdyB6TpgdYxDDQwODox5ZFM7dYnzA4xgveewHed/dz+1Oo nmWbW7Cp+Sh7MpVIOzkXPYIuYHaIrKK74A6Xgbgct1INiujj4AxCsHzvqRHm9AhwsE1l He5MQLUV96qbBfUGmApY3un5Qcwp1sBifK5Ql/FtmNd8djyK3I/TouqR47X2v6P0CTw4 1U/vtqlDt6/diQuXekOy/Jk3+7phNuB0GlePtD/XYsXTU5JcI/LXkFazbTpUBoXa8A3n bDFEZ2fKnJXz3lZcYPWZvXilq6xgxDK0KxI09Fb5n25SHO2YJkUewUbrkRdllLSHvy6T lYOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=W4bW6IDAqxy2f4GLEnl16bZeTQHDEz/iyC6ar1LBEww=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=vxGjdu0gUbVYKaq8oeXB8FTnJefYO7vw3tNMqEFVdmSeWoU//mZ8YxnsducFnLOpwn Vfodr7jwbLjipi9vT0O5R1tQIJopg5NKsTHNBXBpbDeH8uLq1XivGSoISfGsVLuvaaPp pz+Tp+aBeeidMa/3WOfmRwYOM1jIjWs96ZhYgI5CKdVhUqvtq+/aGjQp+Rrs2KzH9+ln L16GrsRenxRd/mD3uqtf7Vp2AKzU4CSR81SMhopoa6NJeC8ZNkci5NMRk14QDiGpOAnV VQSACzgdtR4D4OqoNzHc3p1f0G7iiKbHEnBjjm7L38lq3Sh5muV8Z2JrI5P0/7b12LaI eE6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id be20-20020a0564021a3400b0053dee879dd8si4976414edb.549.2023.11.15.02.20.51; Wed, 15 Nov 2023 02:20:51 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B18D868CCBB; Wed, 15 Nov 2023 12:20:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B61468CC31 for ; Wed, 15 Nov 2023 12:20:29 +0200 (EET) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 9ABE21372 for ; Wed, 15 Nov 2023 11:20:28 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id TcO4Hqk5JCM1 for ; Wed, 15 Nov 2023 11:20:26 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 3FCD291A for ; Wed, 15 Nov 2023 11:20:26 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 259F23A00BD for ; Wed, 15 Nov 2023 11:20:26 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Nov 2023 11:19:40 +0100 Message-ID: <20231115101941.22528-1-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: bTfoDQDctZBx --- tools/general_assembly.pl | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/general_assembly.pl diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl old mode 100644 new mode 100755 From patchwork Wed Nov 15 10:19:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 44669 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:92a5:b0:181:818d:5e7f with SMTP id q37csp2583820pzg; Wed, 15 Nov 2023 02:20:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiG7hnCwY41KDs9R8xwNZRAJJFr0BEYoEmBYh44pOqraMwzWiDpSvzT3emTsSUdUFuYCxG X-Received: by 2002:a17:906:da1d:b0:9e4:198e:6c30 with SMTP id fi29-20020a170906da1d00b009e4198e6c30mr8846312ejb.45.1700043642120; Wed, 15 Nov 2023 02:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700043642; cv=none; d=google.com; s=arc-20160816; b=MBqlnoFzhqjuu1KeLA4DQI1gssw1jlNfx8NV5cszVMqq6t9E7X2xDeFhDH1P0nDlWB +kbhwrpqOocay6sffelm3+/BK+9p1y/UyUTJL5MD12R8nw5QgbhgJ637yKfLgCbNCq1l fS6bjoCwtYVc2rlYWiArNmzB5hpeXoOi2+5KOQsdKwjqlV3y5QuOxoNyKurPpX39YhbF 2aEHCv8KSQmtm5jnvvVdmCwOkDvlLgi51J/AiCMFhmmjRS40AaGYMoXjw3UHDQ8WdR6t NbxgvGGC8lMjXUKr50bXMC6X3Iro28xHufg+saz4f0XutcgMpDAt1PbzRG2y+bJHH1K/ U43w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=8mwxiVfX8EWijhNg5TeQkUHC1oPDKWnqr5oS832eeQc=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=mTfXsrrdT6tKZjqxINuJKWQeBrQ2k54/ULYXqkBl+bQfVW6u8DO1ay1yPczqJAnDa8 fJWOlx//ITooLqinqqTrZDIKEg/UdNlUK0Zcydenyvdf1NKVdCltSMFi2pFpaepvz47b uRUy0BUOeXapsZY6t8nsSVZY2se6W8j72xAzHnWcJglHV4Qf5iIZLP/plGvTadgKYR+7 qfGYrljn+j9ASIFwvFrro/7c0IQnRStiY7fi7IHqlUUsLM3Sw6xMg5H3vGwzhx8A/BmP Je8f9Rdwig95BIv3fMIX/2P5J8AOcxIrMpfkWeMScL4lI1tOgnMi8ZUxdt7UIlUyF2ou iiUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id du14-20020a17090772ce00b009dec36e743asi5671780ejc.728.2023.11.15.02.20.40; Wed, 15 Nov 2023 02:20:42 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8C92C68CCA8; Wed, 15 Nov 2023 12:20:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4760868CB56 for ; Wed, 15 Nov 2023 12:20:29 +0200 (EET) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 9E21413D4 for ; Wed, 15 Nov 2023 11:20:28 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id pmpDp0WzjGx7 for ; Wed, 15 Nov 2023 11:20:26 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 4A1351102 for ; Wed, 15 Nov 2023 11:20:26 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 3369A3A1E9B for ; Wed, 15 Nov 2023 11:20:26 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Nov 2023 11:19:41 +0100 Message-ID: <20231115101941.22528-2-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231115101941.22528-1-anton@khirnov.net> References: <20231115101941.22528-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: update to conform to new rules X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: t4D9bGYCjuI0 --- tools/general_assembly.pl | 64 ++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl index e59ce0f350..4c3208ccac 100755 --- a/tools/general_assembly.pl +++ b/tools/general_assembly.pl @@ -7,8 +7,11 @@ use POSIX qw(strftime); use Encode qw(decode); use Data::Dumper; use Getopt::Long; +use Digest::SHA; +use utf8; -binmode(STDOUT, ":utf8"); +use DateTime; +use DateTime::Format::ISO8601; sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s }; @@ -18,6 +21,7 @@ sub print_help { print " --names Print only the names\n"; print " --emails Print only the email addresses\n"; print " --full Print both names and email addresses (default)\n"; + print " --date YY-MM-DD Generate the GA for a given date, defaults to current system time\n"; print " -h, --help Show this help message\n"; exit; } @@ -25,6 +29,7 @@ sub print_help { my $print_full = 1; my $print_names = 0; my $print_emails = 0; +my $date = DateTime->now()->iso8601; my $help = 0; GetOptions( @@ -32,6 +37,7 @@ GetOptions( "names" => \$print_names, "emails" => \$print_emails, "help" => \$help, + "date=s" => \$date, "h" => \$help, ); @@ -41,7 +47,40 @@ if ($print_names || $print_emails) { $print_full = 0; } -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); +sub get_date_range { + my ($now) = @_; + + # date on which the GA update rule was established, and the voter list + # was extraordinarily updated; cf.: + # * http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2023-October/316054.html + # Message-Id <169818211998.11195.16532637803201641594@lain.khirnov.net> + # * http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2023-November/316618.html + # Message-Id <5efcab06-8510-4226-bf18-68820c7c69ba@betaapp.fastmail.com> + my $date_ga_rule = DateTime->new(year => 2023, month => 11, day => 06); + # date when the regular update rule is first applied + my $date_first_regular = DateTime->new(year => 2024); + + if ($now->is_between($date_ga_rule, $date_first_regular)) { + return ($date_ga_rule->clone()->set_year($date_ga_rule->year - 3), $date_ga_rule); + } + + if ($now < $date_ga_rule) { + print STDERR "GA before $date_ga_rule is not well-defined, be very careful with the output\n"; + } + + my $cur_year_jan = $now->clone()->truncate(to => "year"); + my $cur_year_jul = $cur_year_jan->clone()->set_month(7); + my $date_until = $now > $cur_year_jul ? $cur_year_jul : $cur_year_jan; + my $date_since = $date_until->clone()->set_year($date_until->year - 3); + + return ($date_since, $date_until); +} + +my ($since, $until) = get_date_range(DateTime::Format::ISO8601->parse_datetime($date)); + +my @shortlog = split /\n/, decode('UTF-8', + `git log --pretty=format:"%aN <%aE>" --since="$since" --until="$until" | sort | uniq -c | sort -r`, + Encode::FB_CROAK); my %assembly = (); foreach my $line (@shortlog) { @@ -53,7 +92,10 @@ foreach my $line (@shortlog) { $name = trim $name; 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); + my @commits = split /(^|\n)commit [a-z0-9]{40}(\n|$)/, + decode('UTF-8', + `git log --name-only --use-mailmap --author="$email" --since="$since" --until="$until"`, + Encode::FB_CROAK); foreach my $commit (@commits) { $true++; # if ($commit =~ /\n[\w\/]+\.(c|h|S|asm|texi)/); } @@ -66,14 +108,22 @@ foreach my $line (@shortlog) { $assembly{$name} = $email; } -printf("# %s %s", strftime("%Y-%m-%d", localtime), decode('UTF-8', `git rev-parse HEAD`, Encode::FB_CROAK)); +# generate the output string +my @out_lines; foreach my $name (sort keys %assembly) { my $email = $assembly{$name}; + my $val; if ($print_full) { - printf("%s <%s>\n", $name, $email); + $val = sprintf("%s <%s>", $name, $email); } elsif ($print_names) { - printf("%s\n", $name); + $val = $name; } elsif ($print_emails) { - printf("%s\n", $email); + $val = $email; } + push(@out_lines, ($val)); } +my $out_str = join("\n", @out_lines) . "\n"; +utf8::encode($out_str); + +printf("# GA for $since/$until; %d people; SHA256:%s\n%s", + scalar @out_lines, Digest::SHA::sha256_hex($out_str), $out_str);