From patchwork Thu May 11 08:29:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Dapp X-Patchwork-Id: 92433 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4206138vqo; Thu, 11 May 2023 01:30:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ490x/MmEjQWzSHnY+VgaIdEVmrHiuOOsoRUeAACCwDBJZOtgfu2fXGW73+b93VAHUqRcG2 X-Received: by 2002:a17:907:7251:b0:96a:1ab:b4a2 with SMTP id ds17-20020a170907725100b0096a01abb4a2mr8277934ejc.25.1683793809701; Thu, 11 May 2023 01:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683793809; cv=none; d=google.com; s=arc-20160816; b=azZ/9ZaLZNtX0XHp8uoOA41c8MhTQn0Z1kDgSbS0U8hHmpJbGXAfNINV95MxmCR5zT HK0hsZ7wYj8DJTmn4AVCUTxTnxPc8qcf78NsjU2Irumcv8gXXafAJKEEerWhLg+Hvows PbIPzey+oxpdln2Yw4HVj8D99aba+v2CqW2xX6vJiZMt15zq2eTTvg+8CUC0F20YtLju o7xihDy4l7/ujFWh2aItleitVC73bMv9Om1g+VW//ZoOCsf81tHPNI/4QhQBmvO4DJ2Y Svmd2+q9EITAwJbBGaBte52+V8I7HoJhw+SGD5xjPdrGXr99ueoejJQ+QrKEG2Pud+gz 1gAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:subject:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=mumIrH0ra659cDBGalTTbo0EGWH+PY+cLgqe+eewEew=; b=JMaOMpcnnYe2A6y77jr7D0wRcpGFV0NQTm2hmMrvC0pCSiq8jtfie754YYsHKw9usp YRsZegbvRYCfk38OWnhoobgNgYP3N786cYa+mN7QKe1ll/Hw5Le5Q1qnDKBKhoVcO1sn DgXPp0Txvlxijhbsrltwzk7RqVpe2x5CzilfOF7b5+MTwGaiOTj4qhTw/h1ry+IHYTZJ nOCeC9/cgxuKoIApRchgIAXHHnAQL1KfhHmvkeRWhkbr/CHf2j9APLPmRjpNSqZiVzM/ 2IcOGTDowfKxbhajQUu12RhwZAQJnOCSr7B0dU1Q1rUPq5gsQExJQU0PTrpz9+xWvf5q Ig2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="aSyP/1HY"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id k14-20020a17090646ce00b0095ed7845fbdsi5368389ejs.994.2023.05.11.01.30.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 01:30:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="aSyP/1HY"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 531CC3857343 for ; Thu, 11 May 2023 08:30:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 531CC3857343 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683793808; bh=mumIrH0ra659cDBGalTTbo0EGWH+PY+cLgqe+eewEew=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=aSyP/1HYxFsBBhO7+Wl21Gk2uoHUDumAQ2fu6Qt5sof++A/9a7RxlP2+PrQd2Y+BS MZ7zNJNIE/Sjh/GVctA7C8yhCRZgzwwxarjClh1ifXUe7djmar8Cd4AnSzsQhQjgf6 AubFq3tsw03i/ennQR/kF9B/TrpMrMBqQhczUNuQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id F3E3F3858D33 for ; Thu, 11 May 2023 08:29:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F3E3F3858D33 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-965cc5170bdso1218762966b.2 for ; Thu, 11 May 2023 01:29:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683793758; x=1686385758; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=mumIrH0ra659cDBGalTTbo0EGWH+PY+cLgqe+eewEew=; b=SwnOrEdMnu+JV2ym5Y6Bx37P3dSkH0/PkvvM/OYKfyCISzbw8dyZFBrnromuy96hD6 XTzOvZkQThFiebHPAOVaZBHyu92NOHXRxT4k60/5cYuJp0ttoDxqptXOUge2tYwcIn1+ Hd4u3Wpg0C7qnFEo5wzGOnWKAHjRCcVIOK1aVccOs9XOMA6ayCmQuBLxD3SRX8MmTIlS OwRTlN3101O9Qud/XCYPn5SfESp4/p3DWQ/gEYd9rhWFL3G1t+toxG9WAN2CES1EaB9C dofBH1Z5D2JiwcjrxJIuXQ+NLI4L4SLXMdleVZkGd7jWr4ghzjnvQmVA4OzrBBtG4L4d P+aw== X-Gm-Message-State: AC+VfDyC3LkSPSi9usk66S3QkON1ytNPNTTHw2xCszRAgkTx7W/RzJKb 3lcZTK2z9SkKGYVsYPvBT5wR3lXZ6ak= X-Received: by 2002:a17:907:3602:b0:947:5acb:920c with SMTP id bk2-20020a170907360200b009475acb920cmr16760611ejc.34.1683793758166; Thu, 11 May 2023 01:29:18 -0700 (PDT) Received: from [192.168.1.23] (ip-046-005-130-086.um12.pools.vodafone-ip.de. [46.5.130.86]) by smtp.gmail.com with ESMTPSA id h25-20020a1709070b1900b0094ef923a6ccsm3666216ejl.219.2023.05.11.01.29.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 May 2023 01:29:17 -0700 (PDT) Message-ID: Date: Thu, 11 May 2023 10:29:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: gcc-patches , mliska@suse.cz Subject: [PATCH] mklog.py: Add --commit option. X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: , X-Patchwork-Original-From: Robin Dapp via Gcc-patches From: Robin Dapp Reply-To: Robin Dapp 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-THRID: =?utf-8?q?1765585777573909226?= X-GMAIL-MSGID: =?utf-8?q?1765585777573909226?= Hi, this patch allows mklog.py to be called with a commit hash directly. So, instead of git show | git gcc-mklog git gcc-mklog --commit can be used. When no is given but --commit is specified, HEAD is used instead. The behavior without --commit is the same as before. Is that useful/OK? I find that option a bit easier to work with. Regards Robin contrib/ChangeLog: * mklog.py: Add optional --commit argument. --- contrib/mklog.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/contrib/mklog.py b/contrib/mklog.py index 777212c98d7..25a3b6c0757 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -358,13 +358,23 @@ if __name__ == '__main__': 'file') parser.add_argument('--update-copyright', action='store_true', help='Update copyright in ChangeLog files') + parser.add_argument('--commit', const='HEAD', nargs='?', + help='Use a specific commit instead of a ' + 'patch file or stdin. (essentially git show ' + 'commit-id | git gcc-mklog)') args = parser.parse_args() if args.input == '-': args.input = None if args.directory: root = args.directory - data = open(args.input, newline='\n') if args.input else sys.stdin + if args.commit: + args.input = None + data = subprocess.check_output('git show {}'.format(args.commit), + shell=True, encoding='utf8').strip() + else: + data = open(args.input, newline='\n') if args.input else sys.stdin + if args.update_copyright: update_copyright(data) else: