From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F26BB138A1A for ; Sat, 17 Jan 2015 22:07:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 061A7E09C7; Sat, 17 Jan 2015 22:07:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7C546E09C5 for ; Sat, 17 Jan 2015 22:07:49 +0000 (UTC) Received: from [192.168.0.13] (ip174-67-205-96.oc.oc.cox.net [174.67.205.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id A0538340735; Sat, 17 Jan 2015 22:07:48 +0000 (UTC) Message-ID: <54BADD32.1010907@gentoo.org> Date: Sat, 17 Jan 2015 14:07:46 -0800 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org CC: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Subject: Re: [gentoo-portage-dev] [PATCH] git sync: silence 'git rev-parse' errors References: <1421497732-15029-1-git-send-email-mgorny@gentoo.org> In-Reply-To: <1421497732-15029-1-git-send-email-mgorny@gentoo.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: f2451068-72dc-4311-9c71-8f8559aa14b1 X-Archives-Hash: 76054034232eae5f5eb2dae0a0fd2d7d On 01/17/2015 04:28 AM, Michał Górny wrote: > Discard the git-rev-parse error output to avoid 'fatal: Not a git > repository [...]' errors when checking whether the repository exists. > --- > pym/portage/sync/modules/git/git.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py > index b97d501..02da037 100644 > --- a/pym/portage/sync/modules/git/git.py > +++ b/pym/portage/sync/modules/git/git.py > @@ -36,7 +36,7 @@ class GitSync(SyncBase): > > if not os.path.exists(self.repo.location): > return False > - exitcode = portage.process.spawn_bash("cd %s ; git rev-parse" %\ > + exitcode = portage.process.spawn_bash("cd %s ; git rev-parse 2>/dev/null" %\ > (portage._shell_quote(self.repo.location),), > **portage._native_kwargs(self.spawn_kwargs)) > if exitcode == 128: > Why don't we just skip the git rev-parse call entirely, if not os.path.isdir(os.path.join(self.repo.location, ".git"))? -- Thanks, Zac