commit:     c1977b8672d3af2abc5d7034fd30f35bfad76d38
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 22 08:58:42 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 22 18:59:32 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c1977b86

sync: git: fetch/clone with --verbose if verbose is enabled

Invoking git fetch/clone with --verbose shows the URL of the remote,
which is viable information. Otherwise the user may believe that they
are using a different remote then they are actually using.

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1143
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/sync/modules/git/git.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/portage/sync/modules/git/git.py 
b/lib/portage/sync/modules/git/git.py
index 1914122d9d..24389ca02a 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -139,8 +139,12 @@ class GitSync(NewBase):
         """
         if not self.has_bin:
             return (1, False)
+
+        opts = self.options.get("emerge_config").opts
+
         git_cmd_opts = ""
         quiet = self.settings.get("PORTAGE_QUIET") == "1"
+        verbose = "--verbose" in opts
 
         # We don't want to operate with a .git outside of the given
         # repo in any circumstances.
@@ -170,6 +174,8 @@ class GitSync(NewBase):
 
         if quiet:
             git_cmd_opts += " --quiet"
+        elif verbose:
+            git_cmd_opts += " --verbose"
 
         # The logic here is a bit delicate. We need to balance two things:
         # 1. Having a robust sync mechanism which works unattended.

Reply via email to