From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C8BE215800F for ; Wed, 22 Feb 2023 17:33:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EEEC4E03EC; Wed, 22 Feb 2023 17:33:25 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D6024E03EC for ; Wed, 22 Feb 2023 17:33:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 109DD34095A for ; Wed, 22 Feb 2023 17:33:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 86F838AE for ; Wed, 22 Feb 2023 17:33:23 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1677087197.31a1cbea211633ddb162124ea42d008015f4ab5f.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: /, lib/portage/sync/modules/git/ X-VCS-Repository: proj/portage X-VCS-Files: NEWS lib/portage/sync/modules/git/git.py X-VCS-Directories: lib/portage/sync/modules/git/ / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 31a1cbea211633ddb162124ea42d008015f4ab5f X-VCS-Branch: master Date: Wed, 22 Feb 2023 17:33:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 80a05327-64aa-45fd-9c37-9287fd9e86f6 X-Archives-Hash: 072610c6dc40f6191ae98960635112a7 commit: 31a1cbea211633ddb162124ea42d008015f4ab5f Author: Florian Schmaus gentoo org> AuthorDate: Wed Feb 22 14:11:17 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Feb 22 17:33:17 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=31a1cbea sync: git: report error if volatile repository Previously portage would not report a merge_cmd error if the repository was volatile. This could potentially be the cause of bug #895526, however if it unclear, at the time of writing this, if the repository in the bug is a volatile one. Bug: https://bugs.gentoo.org/895526 Signed-off-by: Florian Schmaus gentoo.org> Closes: https://github.com/gentoo/portage/pull/993 Signed-off-by: Sam James gentoo.org> NEWS | 3 +++ lib/portage/sync/modules/git/git.py | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index ac658c923..210588e20 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,9 @@ Bug fixes: * tests: news: significantly improved test coverage (bug #889330). +* git: also report sync errors for volatile repos. Portage would previously simply + report success if an volatile repository failed to sync. + portage-3.0.44 (2023-01-15) -------------- diff --git a/lib/portage/sync/modules/git/git.py b/lib/portage/sync/modules/git/git.py index 6551ef29d..353f9af07 100644 --- a/lib/portage/sync/modules/git/git.py +++ b/lib/portage/sync/modules/git/git.py @@ -376,15 +376,16 @@ class GitSync(NewBase): **self.spawn_kwargs, ) - if exitcode != os.EX_OK and not self.repo.volatile: - # HACK - sometimes merging results in a tree diverged from - # upstream, so try to hack around it - # https://stackoverflow.com/questions/41075972/how-to-update-a-git-shallow-clone/41081908#41081908 - exitcode = portage.process.spawn( - f"{self.bin_command} reset --hard refs/remotes/{remote_branch}", - cwd=portage._unicode_encode(self.repo.location), - **self.spawn_kwargs, - ) + if exitcode != os.EX_OK: + if not self.repo.volatile: + # HACK - sometimes merging results in a tree diverged from + # upstream, so try to hack around it + # https://stackoverflow.com/questions/41075972/how-to-update-a-git-shallow-clone/41081908#41081908 + exitcode = portage.process.spawn( + f"{self.bin_command} reset --hard refs/remotes/{remote_branch}", + cwd=portage._unicode_encode(self.repo.location), + **self.spawn_kwargs, + ) if exitcode != os.EX_OK: msg = f"!!! git merge error in {self.repo.location}"