From patchwork Wed May 12 08:38:27 2021 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: 1477465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fg7VL0DwPz9sWW for ; Wed, 12 May 2021 18:38:34 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ECDB3386EC57; Wed, 12 May 2021 08:38:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id D47093857009 for ; Wed, 12 May 2021 08:38:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D47093857009 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id CA687AFB1 for ; Wed, 12 May 2021 08:38:27 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] gcc-changelog: respect branch in git_update_version.py. To: gcc-patches@gcc.gnu.org Message-ID: <1bbb36e1-343e-7a21-d4f8-21bdaaeb4ad5@suse.cz> Date: Wed, 12 May 2021 10:38:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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-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@gcc.gnu.org Sender: "Gcc-patches" Hi. The patch fixes Dially bump strict. Pushed to master. Martin contrib/ChangeLog: * gcc-changelog/git_commit.py: Simplify needle lookup. * gcc-changelog/git_update_version.py: Pass ref_name to parse_git_revisions. --- contrib/gcc-changelog/git_commit.py | 2 +- contrib/gcc-changelog/git_update_version.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index c70279e2504..8f9b266fde9 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -394,7 +394,7 @@ class GitCommit: self.changelog_locations = list(default_changelog_locations) if ref_name: version = sys.maxsize - if ref_name.startswith('refs/heads/releases/gcc-'): + if 'releases/gcc-' in ref_name: version = int(ref_name.split('-')[-1]) if version >= 12: # HSA and BRIG were removed in GCC 12 diff --git a/contrib/gcc-changelog/git_update_version.py b/contrib/gcc-changelog/git_update_version.py index 9bc41bb4cc1..0a21a748e72 100755 --- a/contrib/gcc-changelog/git_update_version.py +++ b/contrib/gcc-changelog/git_update_version.py @@ -78,7 +78,7 @@ repo = Repo(args.git_path) origin = repo.remotes['origin'] -def update_current_branch(): +def update_current_branch(ref_name): commit = repo.head.commit commit_count = 1 while commit: @@ -101,7 +101,7 @@ def update_current_branch(): if len(head.parents) == 2: head = head.parents[1] commits = parse_git_revisions(args.git_path, '%s..%s' - % (commit.hexsha, head.hexsha)) + % (commit.hexsha, head.hexsha), ref_name) commits = [c for c in commits if c.info.hexsha not in IGNORED_COMMITS] for git_commit in reversed(commits): prepend_to_changelog_files(repo, args.git_path, git_commit, @@ -145,6 +145,6 @@ else: branch.checkout() origin.pull(rebase=True) print('branch pulled and checked out') - update_current_branch() + update_current_branch(name) assert not repo.index.diff(None) print('branch is done\n', flush=True)