Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable
@ 2023-11-15 10:19 Anton Khirnov
  2023-11-15 10:19 ` [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: update to conform to new rules Anton Khirnov
  2023-11-17  9:40 ` [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable Anton Khirnov
  0 siblings, 2 replies; 3+ messages in thread
From: Anton Khirnov @ 2023-11-15 10:19 UTC (permalink / raw)
  To: ffmpeg-devel

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

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: update to conform to new rules
  2023-11-15 10:19 [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable Anton Khirnov
@ 2023-11-15 10:19 ` Anton Khirnov
  2023-11-17  9:40 ` [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable Anton Khirnov
  1 sibling, 0 replies; 3+ messages in thread
From: Anton Khirnov @ 2023-11-15 10:19 UTC (permalink / raw)
  To: ffmpeg-devel

---
 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);
-- 
2.42.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable
  2023-11-15 10:19 [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable Anton Khirnov
  2023-11-15 10:19 ` [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: update to conform to new rules Anton Khirnov
@ 2023-11-17  9:40 ` Anton Khirnov
  1 sibling, 0 replies; 3+ messages in thread
From: Anton Khirnov @ 2023-11-17  9:40 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Will push the set soon if nobody objects.

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-17  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 10:19 [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable Anton Khirnov
2023-11-15 10:19 ` [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: update to conform to new rules Anton Khirnov
2023-11-17  9:40 ` [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: make the script executable Anton Khirnov

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git