Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: Zac Medico <zmedico@g.o>
Cc: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] sync: call git prune before shallow fetch (bug 599008)
Date: Sat, 05 Nov 2016 21:50:54
Message-Id: 20161105225039.3ead02f2@pomiocik
In Reply to: [gentoo-portage-dev] [PATCH] sync: call git prune before shallow fetch (bug 599008) by Zac Medico
1 On Sat, 5 Nov 2016 13:43:15 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > This is necessary in order to avoid "There are too many unreachable
5 > loose objects" warnings from automatic git gc calls.
6 >
7 > X-Gentoo-Bug: 599008
8 > X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=599008
9 > ---
10 > pym/portage/sync/modules/git/git.py | 6 ++++++
11 > 1 file changed, 6 insertions(+)
12 >
13 > diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py
14 > index f288733..c90cf88 100644
15 > --- a/pym/portage/sync/modules/git/git.py
16 > +++ b/pym/portage/sync/modules/git/git.py
17 > @@ -101,6 +101,12 @@ class GitSync(NewBase):
18 > writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
19 > return (e.returncode, False)
20 >
21 > + # For shallow fetch, unreachable objects must be pruned
22 > + # manually, since otherwise automatic git gc calls will
23 > + # eventually warn about them (see bug 599008).
24 > + subprocess.call(['git', 'prune'],
25 > + cwd=portage._unicode_encode(self.repo.location))
26 > +
27 > git_cmd_opts += " --depth %d" % self.repo.sync_depth
28 > git_cmd = "%s fetch %s%s" % (self.bin_command,
29 > remote_branch.partition('/')[0], git_cmd_opts)
30
31 Does it have a performance impact?
32
33 --
34 Best regards,
35 Michał Górny

Replies