From patchwork Mon Nov 6 18:41:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cosmin Stejerean X-Patchwork-Id: 44539 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3aa6:b0:181:818d:5e7f with SMTP id d38csp1653627pzh; Mon, 6 Nov 2023 10:42:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKHQNallJYpMA1JL33q0Yqqknz+jFVFjUD5JkAnCVbGaonXYZp5wxVDRZaVej2g5IylZ8O X-Received: by 2002:a17:907:9815:b0:9be:30c2:b8ff with SMTP id ji21-20020a170907981500b009be30c2b8ffmr14489314ejc.61.1699296128787; Mon, 06 Nov 2023 10:42:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699296128; cv=none; d=google.com; s=arc-20160816; b=gCygAhSWFwWi9OPakMcVxq7qd7uIVzKZ+ZE8P1UFZTxInYHBxLXX/N6fItV0vpi89q 0ZTaj9tLNmUp4QkjpnypeVz+AXYV0Sm+AdeudgMjCchYFl5G7zyLaZraUZCD7MSasvTe 18lcHAM7tfurgebRYhjS0I7ZHAE3gjn9wjJvmxLE6QnZh3phky+JySsEMbNOD3w+/SMw vzu3Xu1IzWdNO6pDpzMJEInhz/CokeDD/y0pDvMQuT8BT30ieAAmtXK1u93NVZHIJwNC Xe9xag2iUxoGluooc6Mus3psLDnmbePEoP/LSvb7tjCLbaxVl1misF5wvAq0H3ZfmOPQ v8eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:message-id:thread-topic :thread-index:references:in-reply-to:mime-version:date:to :delivered-to; bh=npIWUjlT1w1c1nIBmpSge5811W42ABDhI7ondjTy9C4=; fh=CBS/D0cB4KwqFBY8d8UQ4TY1w6HZ9TulitLE+VqI2+k=; b=V9zJqwfC7Hen8gJZPoyAuL0SoZyDUrEJlWnXxffxCS5y2mkXtug3Q5zdfY1cW4kN5R 7U+e+4uA4xC5yhWb/iUilzuq30e6zzOjmJam61h28mvGApBJ3YbQFCy6kwgmwbtlXlGc 1KIp1B2r9zpJ3QrWbiqJQ6KE9atJpdAOeE18cxWfhNgtKty6s1RNot4saea81hAfn8UD PGOruL28IQob2oCzIesGpVRaLTFCccQk4VcWJkoDVbdbYxScKmckRxP+tqKZJ3m+WdjX QbaR87k4XH+uKJkDmzvP824zmaiAm03XswJtLbwvmANudLHmL1gFExxOB8J8faC/1LDh //bg== 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 qa38-20020a17090786a600b0099cbed6da42si137461ejc.157.2023.11.06.10.42.08; Mon, 06 Nov 2023 10:42:08 -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 F38D368C1E2; Mon, 6 Nov 2023 20:42:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a26-16.smtp-out.us-west-2.amazonses.com (a26-16.smtp-out.us-west-2.amazonses.com [54.240.26.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 466B868C956 for ; Mon, 6 Nov 2023 20:41:57 +0200 (EET) To: =?utf-8?q?ffmpeg-devel=40ffmpeg=2Eorg?= Date: Mon, 6 Nov 2023 18:41:54 +0000 Mime-Version: 1.0 In-Reply-To: <20231106184141.30439-1-cosmin@cosmin.at> References: <20231106184141.30439-1-cosmin@cosmin.at> <20231106184141.30439-2-cosmin@cosmin.at> X-Mailer: Amazon WorkMail Thread-Index: AQHaEODjhDAj8U2DSnGskCDGy4so+gAAAFUp Thread-Topic: [PATCH v2 1/1] tools/general_assembly.pl - add options to print names, emails or both X-Original-Mailer: git-send-email 2.42.1 X-Wm-Sent-Timestamp: 1699296113 Message-ID: <0101018ba5f0f72f-9adc382e-3e73-4fa1-9b7e-8d18dd1a1a50-000000@us-west-2.amazonses.com> Feedback-ID: 1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES X-SES-Outgoing: 2023.11.06-54.240.26.16 Subject: [FFmpeg-devel] [PATCH v2 1/1] tools/general_assembly.pl - add options to print names, emails or both 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: , X-Patchwork-Original-From: Cosmin Stejerean via ffmpeg-devel From: Cosmin Stejerean Reply-To: FFmpeg development discussions and patches Cc: =?utf-8?q?Cosmin_Stejerean?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: vRAmtPmKFo9N Signed-off-by: Cosmin Stejerean --- 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; +} + +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); + } }