mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
tools/general_assembly.pl - add options to print names, emails or both
Signed-off-by: Cosmin Stejerean <cosmin@cosmin.at> Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
b360c91752
commit
575efc0406
@ -6,9 +6,41 @@ use strict;
|
|||||||
use POSIX qw(strftime);
|
use POSIX qw(strftime);
|
||||||
use Encode qw(decode);
|
use Encode qw(decode);
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
use Getopt::Long;
|
||||||
|
|
||||||
|
binmode(STDOUT, ":utf8");
|
||||||
|
|
||||||
sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 @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 = ();
|
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));
|
printf("# %s %s", strftime("%Y-%m-%d", localtime), decode('UTF-8', `git rev-parse HEAD`, Encode::FB_CROAK));
|
||||||
foreach my $email (sort values %assembly) {
|
foreach my $name (sort keys %assembly) {
|
||||||
printf("%s\n", $email);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user