Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] sync: always pass -q to git-update-index
Date: Thu, 03 Nov 2016 00:17:28
Message-Id: 35bdeeea-a996-99b1-f006-a3f2a0ee4c6a@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] sync: always pass -q to git-update-index by Mike Gilbert
1 On 11/02/2016 02:09 PM, Mike Gilbert wrote:
2 > The -q option allows git-update-index to succeed even if there are
3 > locally modified files present.
4 >
5 > X-Gentoo-Bug-URL: https://bugs.gentoo.org/552814#c58
6 > ---
7 > pym/portage/sync/modules/git/git.py | 5 +----
8 > 1 file changed, 1 insertion(+), 4 deletions(-)
9 >
10 > diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py
11 > index dc94ec9..3db6dc1 100644
12 > --- a/pym/portage/sync/modules/git/git.py
13 > +++ b/pym/portage/sync/modules/git/git.py
14 > @@ -118,10 +118,7 @@ class GitSync(NewBase):
15 > if exitcode == os.EX_OK and self.repo.sync_depth is not None:
16 > # update-index --refresh is needed on some filesystems
17 > # (e.g. with overlayfs on squashfs)
18 > - update_index_cmd = [self.bin_command, 'update-index']
19 > - if quiet: # -q needs to go first
20 > - update_index_cmd.append('-q')
21 > - update_index_cmd.append('--refresh')
22 > + update_index_cmd = [self.bin_command, 'update-index', '-q', '--refresh']
23 >
24 > exitcode = subprocess.call(update_index_cmd,
25 > cwd=portage._unicode_encode(self.repo.location))
26 >
27
28 LGTM.
29
30 I just checked the man page, and this behavior is documented there:
31
32 -q
33 Quiet. If --refresh finds that the index needs an update, the default
34 behavior is to error out. This option makes git update-index continue
35 anyway.
36 --
37 Thanks,
38 Zac

Replies