Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] egencache: fix results when GIT_DIR is used in the environment.
Date: Thu, 12 Nov 2015 06:09:51
Message-Id: 56442D26.2020905@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] egencache: fix results when GIT_DIR is used in the environment. by robbat2@gentoo.org
1 On 11/11/2015 02:30 PM, robbat2@g.o wrote:
2 > From: "Robin H. Johnson" <robbat2@g.o>
3 >
4 > If GIT_DIR is used, and .git is outside the root of the checkout, then
5 > --work-tree=... needs to be specified, otherwise any Git command that
6 > relies on relative directories to the root will be wrong.
7 >
8 > Signed-off-by: Robin H. Johnson <robbat2@g.o>
9 > ---
10 > bin/egencache | 31 +++++++++++++++++++++++--------
11 > 1 file changed, 23 insertions(+), 8 deletions(-)
12
13 Looks good.
14
15 > + '--relative=%s' % (cp, ),
16
17 This addition could be mentioned in the commit message.
18
19 > def run(self):
20 > - repo_path = self._portdb.porttrees[0]
21 > - os.chdir(repo_path)
22 > + os.chdir(self._repo_path)
23
24 The chdir calls make me nervous, since we should be careful to ensure
25 that they are timed correctly when we introduce parallelization. I'd
26 love to add a cwd argument for the grab method to pass into Popen, in
27 order to eliminate all of the chdir calls.
28 --
29 Thanks,
30 Zac

Replies