* [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members
@ 2023-11-23 9:14 Anton Khirnov
2023-11-23 9:14 ` [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: restore printing HEAD Anton Khirnov
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Anton Khirnov @ 2023-11-23 9:14 UTC (permalink / raw)
To: ffmpeg-devel
---
tools/general_assembly.pl | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl
index 4c3208ccac..3bf65f3405 100755
--- a/tools/general_assembly.pl
+++ b/tools/general_assembly.pl
@@ -13,6 +13,12 @@ use utf8;
use DateTime;
use DateTime::Format::ISO8601;
+my @extra_members = (
+ # entries should be of the format
+ # [ <name>, <email>, <date elected> ],
+ # ['Foo Bar', 'foo@bar', DateTime->new(year => 8613, month => 5, day => 22)],
+);
+
sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
sub print_help {
@@ -29,7 +35,7 @@ sub print_help {
my $print_full = 1;
my $print_names = 0;
my $print_emails = 0;
-my $date = DateTime->now()->iso8601;
+my $date_str = DateTime->now()->iso8601;
my $help = 0;
GetOptions(
@@ -37,7 +43,7 @@ GetOptions(
"names" => \$print_names,
"emails" => \$print_emails,
"help" => \$help,
- "date=s" => \$date,
+ "date=s" => \$date_str,
"h" => \$help,
);
@@ -76,7 +82,8 @@ sub get_date_range {
return ($date_since, $date_until);
}
-my ($since, $until) = get_date_range(DateTime::Format::ISO8601->parse_datetime($date));
+my $date = DateTime::Format::ISO8601->parse_datetime($date_str);
+my ($since, $until) = get_date_range($date);
my @shortlog = split /\n/, decode('UTF-8',
`git log --pretty=format:"%aN <%aE>" --since="$since" --until="$until" | sort | uniq -c | sort -r`,
@@ -108,6 +115,13 @@ foreach my $line (@shortlog) {
$assembly{$name} = $email;
}
+foreach my $entry (@extra_members) {
+ my $elected = $entry->[2];
+ if ($date->is_between($elected, $elected->clone()->set_year($elected->year + 2))) {
+ $assembly{$entry->[0]} = $entry->[1];
+ }
+}
+
# generate the output string
my @out_lines;
foreach my $name (sort keys %assembly) {
--
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] 7+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: restore printing HEAD
2023-11-23 9:14 [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members Anton Khirnov
@ 2023-11-23 9:14 ` Anton Khirnov
2023-11-26 9:18 ` [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members Anton Khirnov
2023-12-06 19:45 ` Michael Niedermayer
2 siblings, 0 replies; 7+ messages in thread
From: Anton Khirnov @ 2023-11-23 9:14 UTC (permalink / raw)
To: ffmpeg-devel
---
tools/general_assembly.pl | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl
index 3bf65f3405..13c13bb28f 100755
--- a/tools/general_assembly.pl
+++ b/tools/general_assembly.pl
@@ -139,5 +139,7 @@ foreach my $name (sort keys %assembly) {
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);
+printf("# GA for $since/$until; %d people; SHA256:%s; HEAD:%s%s",
+ scalar @out_lines, Digest::SHA::sha256_hex($out_str),
+ decode('UTF-8', `git rev-parse HEAD`, Encode::FB_CROAK),
+ $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] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members
2023-11-23 9:14 [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members Anton Khirnov
2023-11-23 9:14 ` [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: restore printing HEAD Anton Khirnov
@ 2023-11-26 9:18 ` Anton Khirnov
2023-11-26 15:08 ` Alexander Strasser
2023-12-06 19:45 ` Michael Niedermayer
2 siblings, 1 reply; 7+ messages in thread
From: Anton Khirnov @ 2023-11-26 9:18 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Set pushed.
The general_assembly.pl script should now be usable as the authoritative
source for GA members.
--
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] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members
2023-11-26 9:18 ` [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members Anton Khirnov
@ 2023-11-26 15:08 ` Alexander Strasser
2023-11-27 2:37 ` Zhao Zhili
2023-11-28 8:06 ` Anton Khirnov
0 siblings, 2 replies; 7+ messages in thread
From: Alexander Strasser @ 2023-11-26 15:08 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On 2023-11-26 10:18 +0100, Anton Khirnov wrote:
> Set pushed.
>
> The general_assembly.pl script should now be usable as the authoritative
> source for GA members.
The patches mostly LGTM.
My Perl knowledge in general is really mostly from 20 years ago.
So if there is any Perl-ish devil in the details I surely have
overlooked it.
Please pardon me if I missed any details on how the program works.
The edge cases are always the tricky stuff...
One thing about this patch and that program in general is a bit
unfortunate: The use of PerlDate is_between.
Here is the doc I found for it:
$dt->is_between( $lower, $upper )
Checks whether $dt is strictly between two other DateTime objects.
"Strictly" means that $dt must be greater than $lower and less than $upper. If it is equal to either object then this method returns false.
AFAIU it affects the script in 2 places:
1. In subroutine get_date_range:
Here the exact day matching date_ga_rule is treated like
anything >= date_first_regular
2. In the loop adding the extra member. The member would not be added
on both, the day they were elected nor the day 2 years after.
Case 1 should be "strictly academical" and thus not really important
because to my knowledge no vote was started on that day.
For case 2 it will be not important on most days, but it would seem
more common and intuitive to use either the closed interval or a
half open interval. Where including the first and the last day or
including the first and excluding the day seem most natural to me.
Best regards,
Alexander
P.S.
As date calculations always turn out nightmares if you look at them
long enough, it would possible be a good idea to always use UTC and
review how time zones are handled in git CLI.
P.P.S.
For quick reference follow copies for both places referenced above:
Case 1:
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);
}
Case 2:
foreach my $entry (@extra_members) {
my $elected = $entry->[2];
if ($date->is_between($elected, $elected->clone()->set_year($elected->year + 2))) {
$assembly{$entry->[0]} = $entry->[1];
}
}
_______________________________________________
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] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members
2023-11-26 15:08 ` Alexander Strasser
@ 2023-11-27 2:37 ` Zhao Zhili
2023-11-28 8:06 ` Anton Khirnov
1 sibling, 0 replies; 7+ messages in thread
From: Zhao Zhili @ 2023-11-27 2:37 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On Nov 26, 2023, at 23:08, Alexander Strasser <eclipse7@gmx.net> wrote:
>
> On 2023-11-26 10:18 +0100, Anton Khirnov wrote:
>> Set pushed.
>>
>> The general_assembly.pl script should now be usable as the authoritative
>> source for GA members.
>
> The patches mostly LGTM.
>
> My Perl knowledge in general is really mostly from 20 years ago.
> So if there is any Perl-ish devil in the details I surely have
> overlooked it.
>
> Please pardon me if I missed any details on how the program works.
> The edge cases are always the tricky stuff...
>
> One thing about this patch and that program in general is a bit
> unfortunate: The use of PerlDate is_between.
>
> Here is the doc I found for it:
>
> $dt->is_between( $lower, $upper )
> Checks whether $dt is strictly between two other DateTime objects.
>
> "Strictly" means that $dt must be greater than $lower and less than $upper. If it is equal to either object then this method returns false.
>
>
> AFAIU it affects the script in 2 places:
>
> 1. In subroutine get_date_range:
> Here the exact day matching date_ga_rule is treated like
> anything >= date_first_regular
>
> 2. In the loop adding the extra member. The member would not be added
> on both, the day they were elected nor the day 2 years after.
>
> Case 1 should be "strictly academical" and thus not really important
> because to my knowledge no vote was started on that day.
>
> For case 2 it will be not important on most days, but it would seem
> more common and intuitive to use either the closed interval or a
> half open interval. Where including the first and the last day or
> including the first and excluding the day seem most natural to me.
>
>
> Best regards,
> Alexander
>
>
> P.S.
> As date calculations always turn out nightmares if you look at them
> long enough, it would possible be a good idea to always use UTC and
> review how time zones are handled in git CLI.
>
> P.P.S.
> For quick reference follow copies for both places referenced above:
>
> Case 1:
> 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);
> }
>
>
> Case 2:
> foreach my $entry (@extra_members) {
> my $elected = $entry->[2];
> if ($date->is_between($elected, $elected->clone()->set_year($elected->year + 2))) {
> $assembly{$entry->[0]} = $entry->[1];
> }
> }
I can only say wow as I know zero about perl. Is it the same reason to write it in perl as
automake so it can be run everywhere?
> _______________________________________________
> 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".
_______________________________________________
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] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members
2023-11-26 15:08 ` Alexander Strasser
2023-11-27 2:37 ` Zhao Zhili
@ 2023-11-28 8:06 ` Anton Khirnov
1 sibling, 0 replies; 7+ messages in thread
From: Anton Khirnov @ 2023-11-28 8:06 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Alexander Strasser (2023-11-26 16:08:42)
> On 2023-11-26 10:18 +0100, Anton Khirnov wrote:
> > Set pushed.
> >
> > The general_assembly.pl script should now be usable as the authoritative
> > source for GA members.
>
> The patches mostly LGTM.
>
> My Perl knowledge in general is really mostly from 20 years ago.
> So if there is any Perl-ish devil in the details I surely have
> overlooked it.
>
> Please pardon me if I missed any details on how the program works.
> The edge cases are always the tricky stuff...
>
> One thing about this patch and that program in general is a bit
> unfortunate: The use of PerlDate is_between.
>
> Here is the doc I found for it:
>
> $dt->is_between( $lower, $upper )
> Checks whether $dt is strictly between two other DateTime objects.
>
> "Strictly" means that $dt must be greater than $lower and less than $upper. If it is equal to either object then this method returns false.
>
>
> AFAIU it affects the script in 2 places:
>
> 1. In subroutine get_date_range:
> Here the exact day matching date_ga_rule is treated like
> anything >= date_first_regular
>
> 2. In the loop adding the extra member. The member would not be added
> on both, the day they were elected nor the day 2 years after.
>
> Case 1 should be "strictly academical" and thus not really important
> because to my knowledge no vote was started on that day.
>
> For case 2 it will be not important on most days, but it would seem
> more common and intuitive to use either the closed interval or a
> half open interval. Where including the first and the last day or
> including the first and excluding the day seem most natural to me.
These objects are not days, they are specific times with nanosecond
resolution. Since I'm not specifying time in the constructor, it
defaults to the first nanosecond-long instant of the day, so none of
these problems really apply.
--
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] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members
2023-11-23 9:14 [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members Anton Khirnov
2023-11-23 9:14 ` [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: restore printing HEAD Anton Khirnov
2023-11-26 9:18 ` [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members Anton Khirnov
@ 2023-12-06 19:45 ` Michael Niedermayer
2 siblings, 0 replies; 7+ messages in thread
From: Michael Niedermayer @ 2023-12-06 19:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 2574 bytes --]
On Thu, Nov 23, 2023 at 10:14:23AM +0100, Anton Khirnov wrote:
> ---
> tools/general_assembly.pl | 20 +++++++++++++++++---
> 1 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl
> index 4c3208ccac..3bf65f3405 100755
> --- a/tools/general_assembly.pl
> +++ b/tools/general_assembly.pl
> @@ -13,6 +13,12 @@ use utf8;
> use DateTime;
> use DateTime::Format::ISO8601;
>
> +my @extra_members = (
> + # entries should be of the format
> + # [ <name>, <email>, <date elected> ],
> + # ['Foo Bar', 'foo@bar', DateTime->new(year => 8613, month => 5, day => 22)],
> +);
> +
> sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
>
> sub print_help {
> @@ -29,7 +35,7 @@ sub print_help {
> my $print_full = 1;
> my $print_names = 0;
> my $print_emails = 0;
> -my $date = DateTime->now()->iso8601;
> +my $date_str = DateTime->now()->iso8601;
> my $help = 0;
>
> GetOptions(
> @@ -37,7 +43,7 @@ GetOptions(
> "names" => \$print_names,
> "emails" => \$print_emails,
> "help" => \$help,
> - "date=s" => \$date,
> + "date=s" => \$date_str,
> "h" => \$help,
> );
>
> @@ -76,7 +82,8 @@ sub get_date_range {
> return ($date_since, $date_until);
> }
>
> -my ($since, $until) = get_date_range(DateTime::Format::ISO8601->parse_datetime($date));
> +my $date = DateTime::Format::ISO8601->parse_datetime($date_str);
> +my ($since, $until) = get_date_range($date);
>
> my @shortlog = split /\n/, decode('UTF-8',
> `git log --pretty=format:"%aN <%aE>" --since="$since" --until="$until" | sort | uniq -c | sort -r`,
> @@ -108,6 +115,13 @@ foreach my $line (@shortlog) {
> $assembly{$name} = $email;
> }
>
> +foreach my $entry (@extra_members) {
> + my $elected = $entry->[2];
> + if ($date->is_between($elected, $elected->clone()->set_year($elected->year + 2))) {
tools/general_assembly.pl
Can't locate object method "is_between" via package "DateTime" at tools/general_assembly.pl line 75.
is_between seems to have been added in 1.52 2020-02-29
So this is unavailable in several distros, it works with cpan though
but this shoould be docuemnted if it cannot be avoided
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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] 7+ messages in thread
end of thread, other threads:[~2023-12-06 19:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23 9:14 [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members Anton Khirnov
2023-11-23 9:14 ` [FFmpeg-devel] [PATCH 2/2] tools/general_assembly: restore printing HEAD Anton Khirnov
2023-11-26 9:18 ` [FFmpeg-devel] [PATCH 1/2] tools/general_assembly: implement extra GA members Anton Khirnov
2023-11-26 15:08 ` Alexander Strasser
2023-11-27 2:37 ` Zhao Zhili
2023-11-28 8:06 ` Anton Khirnov
2023-12-06 19:45 ` Michael Niedermayer
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