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 E05DB158089 for ; Tue, 31 Oct 2023 00:35:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A7EA2BC033; Tue, 31 Oct 2023 00:35:23 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 pigeon.gentoo.org (Postfix) with ESMTPS id DED3C2BC033 for ; Tue, 31 Oct 2023 00:35:22 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CC6AD335CCD for ; Tue, 31 Oct 2023 00:35:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3C858922 for ; Tue, 31 Oct 2023 00:35:20 +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: <1698712489.34b619eb646e8de4041268f05b04c44db9485243.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/sync/modules/git/ X-VCS-Repository: proj/portage X-VCS-Files: 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: 34b619eb646e8de4041268f05b04c44db9485243 X-VCS-Branch: master Date: Tue, 31 Oct 2023 00:35:20 +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: be02ff7b-3257-4115-a961-f812f426a3d2 X-Archives-Hash: 658014850b6ec76869e98b328ae14692 commit: 34b619eb646e8de4041268f05b04c44db9485243 Author: Florian Schmaus gentoo org> AuthorDate: Mon Oct 30 18:21:45 2023 +0000 Commit: Sam James gentoo org> CommitDate: Tue Oct 31 00:34:49 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=34b619eb sync/git: invoke add_safe_directory() earlier when updating a repo Otherwise "git rev-parse --is-shallow-repository" may fail fatal: detected dubious ownership in repository at '/home/flo/data/repos/gentoo/tex-overlay' To add an exception for this directory, call: git config --global --add safe.directory /home/flo/data/repos/gentoo/tex-overlay Traceback (most recent call last): File "/usr/lib/python3.12/site-packages/portage/util/_async/AsyncFunction.py", line 41, in _target_wrapper result = target(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/sync/controller.py", line 172, in sync taskmaster.run_tasks(tasks, func, status, options=task_opts) File "/usr/lib/python3.12/site-packages/portage/sync/controller.py", line 65, in run_tasks result = getattr(inst, func)(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/sync/syncbase.py", line 370, in sync return self.update() ^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/portage/sync/modules/git/git.py", line 242, in update subprocess.check_output( File "/usr/lib/python3.12/subprocess.py", line 466, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['git', 'rev-parse', '--is-shallow-repository']' returned non-zero exit status 128. Signed-off-by: Florian Schmaus gentoo.org> Closes: https://github.com/gentoo/portage/pull/1171 Signed-off-by: Sam James gentoo.org> lib/portage/sync/modules/git/git.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/portage/sync/modules/git/git.py b/lib/portage/sync/modules/git/git.py index 24389ca02a..48109b7844 100644 --- a/lib/portage/sync/modules/git/git.py +++ b/lib/portage/sync/modules/git/git.py @@ -152,6 +152,8 @@ class GitSync(NewBase): {"GIT_CEILING_DIRECTORIES": self._gen_ceiling_string(self.repo.location)} ) + self.add_safe_directory() + if self.repo.module_specific_options.get("sync-git-env"): shlexed_env = shlex_split(self.repo.module_specific_options["sync-git-env"]) env = { @@ -261,8 +263,6 @@ class GitSync(NewBase): f" {self.repo.module_specific_options['sync-git-pull-extra-opts']}" ) - self.add_safe_directory() - try: remote_branch = portage._unicode_decode( subprocess.check_output(