From patchwork Fri Jul 22 09:41:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 122 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f503:0:0:0:0:0 with SMTP id q3csp151055wro; Fri, 22 Jul 2022 02:41:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uwEQFNSMggOSG74l8UGaiPTXXT0VIdKJpVN/citA9e2fmVnTPhzRmmgGKE7W3ogFkZhUoI X-Received: by 2002:a17:907:9613:b0:72b:68df:8ada with SMTP id gb19-20020a170907961300b0072b68df8adamr2526360ejc.31.1658482896905; Fri, 22 Jul 2022 02:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658482896; cv=none; d=google.com; s=arc-20160816; b=1GFZChQ8qVQgU9/AHs1HQJXouq1MiuOu23AA5llZbFKJpip1xbms3risLndNA2+Vb2 TakSIO70P+kazFYXP+EJkoDYWL5ruDQNaF0Gj3DiVEVlqir4MfDc0RJDnR3okvDcxczo NkviE9iOUUW4FKrxbIe6908tPoriFwCLqAQCAEsGDuIF2PxVqm/t2UuiMZCcQQ/Pwjfi CROceU6p77b9ZDK4U9LWqE4E/Obm90zn57/1W65JunGI3PyMaZV66CWAZo+5+42XAfiW jybNCyfa7W43eVRPsfyJYXFkMjX+9Cbd4yaFY7yVPCsAlZvYZWH4FQqVkHHDNh32xSio HcdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:to:subject:from:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature:dmarc-filter:delivered-to; bh=k14KMg5SCTjc4+sRf/wJ09jS1uid1N92xaVA+e5yJ/U=; b=PFWl6VFkPP8HDXZTjYomNdWDmWOuznWijrjEFDSQf6RGqg1dVmUHzZRjkqDWrot/2b Ubr2cNPElWKGo4GLz3T4vzWCHLXoOeB5GMPNmRfN4quOaOJ9KbJcPHdLFZMzJRt7XupL GAqmBTdZZgur+lg7ZZIog9kMXXj/oGIIEb6DIbc9Oww4ZR07O7ttYALZlHLUThfDycfE bukwq8tUXoc1C+kP3kO2z6H95cVaEgrbEdqTVBwUcc9xAaNyDVxBc3K840fET51WAOTQ SRUt/0DcNbw71S/88U/gypWIhX/mP/CkxG2dI5mX9FrBnQ7EvPH44wyB0GeIkeMUzveH j+6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=jXBiLmkB; dkim=neutral (no key) header.i=@gcc.gnu.org header.b=+8VIRB7Z; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dr18-20020a170907721200b0072b83d4de3asi6238222ejc.608.2022.07.22.02.41.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 02:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=jXBiLmkB; dkim=neutral (no key) header.i=@gcc.gnu.org header.b=+8VIRB7Z; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A5963834E52 for ; Fri, 22 Jul 2022 09:41:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 291503857C5D for ; Fri, 22 Jul 2022 09:41:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 291503857C5D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 48EBA37658 for ; Fri, 22 Jul 2022 09:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1658482867; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k14KMg5SCTjc4+sRf/wJ09jS1uid1N92xaVA+e5yJ/U=; b=jXBiLmkBylK7Vd/YNKhMJNN7iO2XS+K/tRsRzJsQm7fONUsMaKu/vOjMpcfIe6bdtlhBaS qyqZ4piL24FwKQY3JShazkEPmLlk+C8benGadSiGKjG2j1nLFxP7MCSspUbzksHcsEazKq J7Wm8KcUtyIQvK7/Q7iyqYhs5nHM2ts= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1658482867; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k14KMg5SCTjc4+sRf/wJ09jS1uid1N92xaVA+e5yJ/U=; b=+8VIRB7Z+GpL5ZFxXv8DnJnS+w00ZsUgc7ST554TuzqNbPjKQL2tf3yFrYCr9rtUwm32CK 0UUa9wtmRB9l+QAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2DAA1134A9 for ; Fri, 22 Jul 2022 09:41:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id fJMSCbNw2mJmawAAMHmgww (envelope-from ) for ; Fri, 22 Jul 2022 09:41:07 +0000 Message-ID: <4e884298-3b97-1ed9-3c34-9e161d49cd8b@suse.cz> Date: Fri, 22 Jul 2022 11:41:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH][pushed] mklog: fill-up subject prefix only for a single PR To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-LABELS: =?utf-8?b?IlxcSW1wb3J0YW50Ig==?= X-GMAIL-THRID: =?utf-8?q?1739045362382612178?= X-GMAIL-MSGID: =?utf-8?q?1739045362382612178?= I've just pushed this one. Martin contrib/ChangeLog: * mklog.py: Use component: [PR xyz] only when one PR is used. --- contrib/mklog.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/contrib/mklog.py b/contrib/mklog.py index cd5ef0bcc74..8693767a7f6 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -73,8 +73,6 @@ PATCH must be generated using diff(1)'s -up or -cp options script_folder = os.path.realpath(__file__) root = os.path.dirname(os.path.dirname(script_folder)) -firstpr = '' - def find_changelog(path): folder = os.path.split(path)[0] @@ -157,12 +155,13 @@ def get_rel_path_if_prefixed(path, folder): def generate_changelog(data, no_functions=False, fill_pr_titles=False, additional_prs=None): + global prs + prs = [] + changelogs = {} changelog_list = [] - prs = [] out = '' diff = PatchSet(data) - global firstpr if additional_prs: for apr in additional_prs: @@ -212,9 +211,6 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False, if pr not in this_file_prs and pr2 not in prs: prs.append(pr2) - if prs: - firstpr = prs[0] - if fill_pr_titles: out += get_pr_titles(prs) @@ -372,11 +368,12 @@ if __name__ == '__main__': end = lines[len(start):] with open(args.changelog, 'w') as f: if not start or not start[0]: - # initial commit subject line 'component: [PRnnnnn]' - m = prnum_regex.match(firstpr) - if m: - title = f'{m.group("comp")}: [PR{m.group("num")}]' - start.insert(0, title) + if len(prs) == 1: + # initial commit subject line 'component: [PRnnnnn]' + m = prnum_regex.match(prs[0]) + if m: + title = f'{m.group("comp")}: [PR{m.group("num")}]' + start.insert(0, title) if start: # append empty line if start[-1] != '':