From: Stefano Sabatini <stefasab@gmail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Cosmin Stejerean <cosmin@cosmin.at> Subject: Re: [FFmpeg-devel] [PATCH v2 1/1] tools/general_assembly.pl - add options to print names, emails or both Date: Tue, 7 Nov 2023 00:53:14 +0100 Message-ID: <ZUl8agdVLHAlTLFb@mariano> (raw) In-Reply-To: <0101018ba5f0f72f-9adc382e-3e73-4fa1-9b7e-8d18dd1a1a50-000000@us-west-2.amazonses.com> On date Monday 2023-11-06 18:41:54 +0000, ffmpeg-devel Mailing List wrote: > Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at> > --- > tools/general_assembly.pl | 43 +++++++++++++++++++++++++++++++++++++-- > 1 file changed, 41 insertions(+), 2 deletions(-) > > diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl > index 898a6262ef..8204d89794 100644 > --- a/tools/general_assembly.pl > +++ b/tools/general_assembly.pl > @@ -6,9 +6,41 @@ use strict; > use POSIX qw(strftime); > use Encode qw(decode); > use Data::Dumper; > +use Getopt::Long; > + > +binmode(STDOUT, ":utf8"); > > sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s }; > > +sub print_help { > + print "Usage: $0 [options]\n"; > + print "Options:\n"; > + 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 " -h, --help Show this help message\n"; > + exit; while at it: use Pod::Usage; ... Getopt::Long::Configure ("bundling"); ... 'help|usage|h' => sub { pod2usage( -verbose => 1, -exitval => 0) }, > +} > + > +my $print_full = 1; > +my $print_names = 0; > +my $print_emails = 0; > +my $help = 0; > + > +GetOptions( > + "full" => \$print_full, > + "names" => \$print_names, > + "emails" => \$print_emails, > + "help" => \$help, > + "h" => \$help, > +); > + > +print_help() if $help; > + > +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); > my %assembly = (); > > @@ -35,6 +67,13 @@ foreach my $line (@shortlog) { > } > > 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); > +foreach my $name (sort keys %assembly) { > + my $email = $assembly{$name}; > + if ($print_full) { > + printf("%s <%s>\n", $name, $email); > + } elsif ($print_names) { > + printf("%s\n", $name); > + } elsif ($print_emails) { > + printf("%s\n", $email); > + } LGTM anyway. _______________________________________________ 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".
next prev parent reply other threads:[~2023-11-06 23:53 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20231106184141.30439-1-cosmin@cosmin.at> 2023-11-06 18:41 ` [FFmpeg-devel] [PATCH v2 0/1] " Cosmin Stejerean via ffmpeg-devel [not found] ` <20231106184141.30439-2-cosmin@cosmin.at> 2023-11-06 18:41 ` [FFmpeg-devel] [PATCH v2 1/1] " Cosmin Stejerean via ffmpeg-devel 2023-11-06 23:53 ` Stefano Sabatini [this message] 2023-11-14 17:47 ` Anton Khirnov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ZUl8agdVLHAlTLFb@mariano \ --to=stefasab@gmail.com \ --cc=cosmin@cosmin.at \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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