public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] sync: call git prune before shallow fetch (bug 599008)
@ 2016-11-05 20:43 Zac Medico
  2016-11-05 21:50 ` Michał Górny
  0 siblings, 1 reply; 8+ messages in thread
From: Zac Medico @ 2016-11-05 20:43 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

This is necessary in order to avoid "There are too many unreachable
loose objects" warnings from automatic git gc calls.

X-Gentoo-Bug: 599008
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=599008
---
 pym/portage/sync/modules/git/git.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py
index f288733..c90cf88 100644
--- a/pym/portage/sync/modules/git/git.py
+++ b/pym/portage/sync/modules/git/git.py
@@ -101,6 +101,12 @@ class GitSync(NewBase):
 				writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
 				return (e.returncode, False)
 
+			# For shallow fetch, unreachable objects must be pruned
+			# manually, since otherwise automatic git gc calls will
+			# eventually warn about them (see bug 599008).
+			subprocess.call(['git', 'prune'],
+				cwd=portage._unicode_encode(self.repo.location))
+
 			git_cmd_opts += " --depth %d" % self.repo.sync_depth
 			git_cmd = "%s fetch %s%s" % (self.bin_command,
 				remote_branch.partition('/')[0], git_cmd_opts)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-11-06 19:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-05 20:43 [gentoo-portage-dev] [PATCH] sync: call git prune before shallow fetch (bug 599008) Zac Medico
2016-11-05 21:50 ` Michał Górny
2016-11-05 22:11   ` Zac Medico
2016-11-05 22:22     ` Michał Górny
2016-11-05 22:56       ` Zac Medico
2016-11-06  9:59         ` Michał Górny
2016-11-06 18:46           ` Zac Medico
2016-11-06 19:37             ` Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox