summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Wasilczyk <twasilczyk@google.com>2024-01-05 12:23:10 -0800
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-01-05 21:40:43 +0000
commit208f34495086eba60f744408aa26b4c62d6db6c6 (patch)
treeea9289ad709323b675edd7760bf07af6a501c406
parent138c8a9ff543ce93c0e0a72581b255a0cb136994 (diff)
downloadgit-repo-208f34495086eba60f744408aa26b4c62d6db6c6.tar.gz
Clean up remaining `repo sync` log spam.
There are still some verbose messages (e.g. "remote: ...") when doing repo sync after a couple days. Let's hide them behind verbose flag. Bug: N/A Test: repo sync Change-Id: I1408472c95ed80d9555adfe8f92211245c03cf41 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/400855 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Tested-by: Tomasz Wasilczyk <twasilczyk@google.com> Commit-Queue: Tomasz Wasilczyk <twasilczyk@google.com>
-rw-r--r--project.py37
-rw-r--r--subcmds/sync.py4
2 files changed, 23 insertions, 18 deletions
diff --git a/project.py b/project.py
index 9dc7feae..db74c651 100644
--- a/project.py
+++ b/project.py
@@ -1636,9 +1636,9 @@ class Project:
1636 elif pub == head: 1636 elif pub == head:
1637 # All published commits are merged, and thus we are a 1637 # All published commits are merged, and thus we are a
1638 # strict subset. We can fast-forward safely. 1638 # strict subset. We can fast-forward safely.
1639 syncbuf.later1(self, _doff) 1639 syncbuf.later1(self, _doff, not verbose)
1640 if submodules: 1640 if submodules:
1641 syncbuf.later1(self, _dosubmodules) 1641 syncbuf.later1(self, _dosubmodules, not verbose)
1642 return 1642 return
1643 1643
1644 # Examine the local commits not in the remote. Find the 1644 # Examine the local commits not in the remote. Find the
@@ -1697,10 +1697,10 @@ class Project:
1697 def _dorebase(): 1697 def _dorebase():
1698 self._Rebase(upstream="%s^1" % last_mine, onto=revid) 1698 self._Rebase(upstream="%s^1" % last_mine, onto=revid)
1699 1699
1700 syncbuf.later2(self, _dorebase) 1700 syncbuf.later2(self, _dorebase, not verbose)
1701 if submodules: 1701 if submodules:
1702 syncbuf.later2(self, _dosubmodules) 1702 syncbuf.later2(self, _dosubmodules, not verbose)
1703 syncbuf.later2(self, _docopyandlink) 1703 syncbuf.later2(self, _docopyandlink, not verbose)
1704 elif local_changes: 1704 elif local_changes:
1705 try: 1705 try:
1706 self._ResetHard(revid) 1706 self._ResetHard(revid)
@@ -1711,9 +1711,9 @@ class Project:
1711 fail(e) 1711 fail(e)
1712 return 1712 return
1713 else: 1713 else:
1714 syncbuf.later1(self, _doff) 1714 syncbuf.later1(self, _doff, not verbose)
1715 if submodules: 1715 if submodules:
1716 syncbuf.later1(self, _dosubmodules) 1716 syncbuf.later1(self, _dosubmodules, not verbose)
1717 1717
1718 def AddCopyFile(self, src, dest, topdir): 1718 def AddCopyFile(self, src, dest, topdir):
1719 """Mark |src| for copying to |dest| (relative to |topdir|). 1719 """Mark |src| for copying to |dest| (relative to |topdir|).
@@ -2883,10 +2883,12 @@ class Project:
2883 if GitCommand(self, cmd).Wait() != 0: 2883 if GitCommand(self, cmd).Wait() != 0:
2884 raise GitError(f"{self.name} rebase {upstream} ", project=self.name) 2884 raise GitError(f"{self.name} rebase {upstream} ", project=self.name)
2885 2885
2886 def _FastForward(self, head, ffonly=False): 2886 def _FastForward(self, head, ffonly=False, quiet=True):
2887 cmd = ["merge", "--no-stat", head] 2887 cmd = ["merge", "--no-stat", head]
2888 if ffonly: 2888 if ffonly:
2889 cmd.append("--ff-only") 2889 cmd.append("--ff-only")
2890 if quiet:
2891 cmd.append("-q")
2890 if GitCommand(self, cmd).Wait() != 0: 2892 if GitCommand(self, cmd).Wait() != 0:
2891 raise GitError(f"{self.name} merge {head} ", project=self.name) 2893 raise GitError(f"{self.name} merge {head} ", project=self.name)
2892 2894
@@ -3759,17 +3761,20 @@ class _Failure:
3759 3761
3760 3762
3761class _Later: 3763class _Later:
3762 def __init__(self, project, action): 3764 def __init__(self, project, action, quiet):
3763 self.project = project 3765 self.project = project
3764 self.action = action 3766 self.action = action
3767 self.quiet = quiet
3765 3768
3766 def Run(self, syncbuf): 3769 def Run(self, syncbuf):
3767 out = syncbuf.out 3770 out = syncbuf.out
3768 out.project("project %s/", self.project.RelPath(local=False)) 3771 if not self.quiet:
3769 out.nl() 3772 out.project("project %s/", self.project.RelPath(local=False))
3773 out.nl()
3770 try: 3774 try:
3771 self.action() 3775 self.action()
3772 out.nl() 3776 if not self.quiet:
3777 out.nl()
3773 return True 3778 return True
3774 except GitError: 3779 except GitError:
3775 out.nl() 3780 out.nl()
@@ -3805,11 +3810,11 @@ class SyncBuffer:
3805 self._failures.append(_Failure(project, err)) 3810 self._failures.append(_Failure(project, err))
3806 self._MarkUnclean() 3811 self._MarkUnclean()
3807 3812
3808 def later1(self, project, what): 3813 def later1(self, project, what, quiet):
3809 self._later_queue1.append(_Later(project, what)) 3814 self._later_queue1.append(_Later(project, what, quiet))
3810 3815
3811 def later2(self, project, what): 3816 def later2(self, project, what, quiet):
3812 self._later_queue2.append(_Later(project, what)) 3817 self._later_queue2.append(_Later(project, what, quiet))
3813 3818
3814 def Finish(self): 3819 def Finish(self):
3815 self._PrintMessages() 3820 self._PrintMessages()
diff --git a/subcmds/sync.py b/subcmds/sync.py
index ac6a451b..ec4bf60d 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -618,7 +618,7 @@ later is required to fix a server side protocol bug.
618 618
619 if not use_super: 619 if not use_super:
620 continue 620 continue
621 m.superproject.SetQuiet(opt.quiet) 621 m.superproject.SetQuiet(not opt.verbose)
622 print_messages = git_superproject.PrintMessages( 622 print_messages = git_superproject.PrintMessages(
623 opt.use_superproject, m 623 opt.use_superproject, m
624 ) 624 )
@@ -1501,7 +1501,7 @@ later is required to fix a server side protocol bug.
1501 buf = TeeStringIO(sys.stdout) 1501 buf = TeeStringIO(sys.stdout)
1502 try: 1502 try:
1503 result = mp.Sync_NetworkHalf( 1503 result = mp.Sync_NetworkHalf(
1504 quiet=opt.quiet, 1504 quiet=not opt.verbose,
1505 output_redir=buf, 1505 output_redir=buf,
1506 verbose=opt.verbose, 1506 verbose=opt.verbose,
1507 current_branch_only=self._GetCurrentBranchOnly( 1507 current_branch_only=self._GetCurrentBranchOnly(