From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 4E7C93939C36; Mon, 21 Jun 2021 12:53:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4E7C93939C36 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F3A1D219BF; Mon, 21 Jun 2021 12:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1624279998; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7lLLc3FTcdEgyKY8Wu5ncicL3RiOEGlE/lndSTjg6Ps=; b=HCdojeVSUezMuIJiFIp3wli/lFFAuBnvMc2UAVX4D/oFFHpYKCBOZQRjPIoPDjhYCjoVbF 95z3UnVpaTRTsZEzXj7IIQFVLgxFaTcUVFTxLAGzjmIc4Lm7FWenmgxP8HyMqL6AX+5ehh hcBpYaNHrW2pi8iu3qWtoYH++X75VZc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1624279998; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7lLLc3FTcdEgyKY8Wu5ncicL3RiOEGlE/lndSTjg6Ps=; b=LSEqg62PxLbabuUxaCc66KRfzft93K9SNFa7BcVWLyG/6lk8MbrqQI8AxsiEQKnwcrPXPo Dy85g1ldqvmR2DDA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id D0874118DD; Mon, 21 Jun 2021 12:53:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1624279997; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7lLLc3FTcdEgyKY8Wu5ncicL3RiOEGlE/lndSTjg6Ps=; b=ny3yTcq4t2/ZRietrPdvMmiwIy9FE833qiKtwtDDWa4gNenhfPwhvusbX/0Nwnf7HFZz78 C+ICx1bU1kw/Tg0v1EYzL8DD1GReRifb+99h2Hlg5ukq2As+1vwpl+mhbbdWPP0503XESe RARL9sW4jhOvSqzApQnLvtT7Fyi/lwU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1624279997; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7lLLc3FTcdEgyKY8Wu5ncicL3RiOEGlE/lndSTjg6Ps=; b=LGWxWskj8vKBvz8tX8K628OSQ7GIxp/dkJ8hkzTqhLaeH48QxBPEU6teN8fPhEmm6Zz41I aUuLhuTsQhdO3GBQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id MWvBMb2L0GDuPQAALh3uQQ (envelope-from ); Mon, 21 Jun 2021 12:53:17 +0000 Subject: Re: [Patch, v2] contrib/mklog.py: Improve PR handling (was: Re: git gcc-commit-mklog doesn't extract PR number to ChangeLog) To: Tobias Burnus , Martin Sebor , Jason Merrill Cc: Jakub Jelinek , gcc Mailing List , Jonathan Wakely , gcc-patches References: <20210610173005.GI7746@tucnak> <20210610190941.GJ7746@tucnak> <58b63929-01f5-038c-931c-9ff8349d9f95@gmail.com> <71b4a023-efb2-6c6a-9ced-93cce7c96540@gmail.com> <3c66efd4-eb5e-f2bb-6138-4126b5909c9c@codesourcery.com> <80fee54a-c007-a62b-20e2-41bb54a2bd00@suse.cz> <870491ea-a0bf-3ac3-14d3-1aec951a356c@codesourcery.com> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <0e604906-df5a-455b-9a26-4c5519e261b6@suse.cz> Date: Mon, 21 Jun 2021 14:53:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <870491ea-a0bf-3ac3-14d3-1aec951a356c@codesourcery.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 12:53:20 -0000 On 6/21/21 10:37 AM, Tobias Burnus wrote: > On 21.06.21 10:09, Martin Liška wrote: > >> $ pytest test_mklog.py >> FAILED test_mklog.py::TestMklog::test_sorting - AssertionError: assert >> '\n\tPR 50209...New test.\n\n' == 'gcc/ChangeLo...New test.\n\n' > Aha, missed that there is indeed a testsuite - nice! >> $ flake8 mklog.py >> mklog.py:187:23: Q000 Remove bad quotes > I have now filled: > https://bugs.launchpad.net/ubuntu/+source/python-pytest-flake8/+bug/1933075 > >>> +            # PR number in the file name >>> +            fname = os.path.basename(file.path) >> >> This is a dead code. >> >>> + fname = os.path.splitext(fname)[0] >>> +            m = pr_filename_regex.search(fname) > It does not look like dead code to me. Hello. The code is weird as os.path.basename returns: In [5]: os.path.basename('/tmp/a/b/c.txt') Out[5]: 'c.txt' why do you need os.path.splitext(fname) call? >>> + parser.add_argument('-b', '--pr-numbers', action='append', >>> +                        help='Add the specified PRs (comma separated)') >> >> Do we really want to support '-b 1 -b 2' and also -b '1,2' formats? >> Seems to me quite >> complicated. > > I don't have a strong opinion. I started with '-b 123,245', believing > that the syntax is fine. But then I realized that without '-p' > specifying multiple '-b' looks better by having multiple '-b' if 'PR > /'  (needed for -p as the string is than taken as is). Thus, > I ended up supporting either variant. I would start with -b 1,2,3,4 syntax. It will be likely easier for git alias integration. Martin > > But I also happily drop the ',' support. > > Change: One quote change, one test_mklog update. > > Tobias > > ----------------- > Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf