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 8D581138A1A for ; Sun, 18 Jan 2015 00:31:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CD924E08EB; Sun, 18 Jan 2015 00:31:26 +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 3E5E2E08E2 for ; Sun, 18 Jan 2015 00:31:26 +0000 (UTC) Received: from pomiot.lan (77-253-152-100.adsl.inetia.pl [77.253.152.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id DAF96340682; Sun, 18 Jan 2015 00:31:23 +0000 (UTC) Date: Sun, 18 Jan 2015 01:31:14 +0100 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= To: Zac Medico Cc: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH] git sync: silence 'git rev-parse' errors Message-ID: <20150118013114.3d4b57b2@pomiot.lan> In-Reply-To: <54BADD32.1010907@gentoo.org> References: <1421497732-15029-1-git-send-email-mgorny@gentoo.org> <54BADD32.1010907@gentoo.org> Organization: Gentoo X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) 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 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/UoIQG1GhoXqqjKNl505DfSG"; protocol="application/pgp-signature" X-Archives-Salt: fe232b41-b858-46df-94c7-bb629e719632 X-Archives-Hash: 050d5c5b42faebc3e840170f2c6567dc --Sig_/UoIQG1GhoXqqjKNl505DfSG Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dnia 2015-01-17, o godz. 14:07:46 Zac Medico napisa=C5=82(a): > On 01/17/2015 04:28 AM, Micha=C5=82 G=C3=B3rny 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(-) > >=20 > > diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/mod= ules/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): > > =20 > > if not os.path.exists(self.repo.location): > > return False > > - exitcode =3D portage.process.spawn_bash("cd %s ; git rev-parse" %\ > > + exitcode =3D portage.process.spawn_bash("cd %s ; git rev-parse 2>/de= v/null" %\ > > (portage._shell_quote(self.repo.location),), > > **portage._native_kwargs(self.spawn_kwargs)) > > if exitcode =3D=3D 128: > >=20 >=20 > Why don't we just skip the git rev-parse call entirely, if not > os.path.isdir(os.path.join(self.repo.location, ".git"))? I don't know ;). I guess the current magic is more 'correct', i.e. distinguishes broken repo. Of course, it all will probably fall apart if it's broken but...! --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/UoIQG1GhoXqqjKNl505DfSG Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJUuv7SXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2REJCMDdDQzRGMERBRDA2RUEwQUZFNDFC MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZORCEP/33rAAbMlRZIRFXJXT3Ikt8t qLwbRbysCJIlVUhXcyedPtAqDGHeKma6doc4EXDjI+C9cxjxqeOMI/h98386sujK 8Z6bPZ4o2/fwXzgZB9a0D9gkoaxxLn5b0iuEoZxWmDrCub8XnPK8a/3Dd3oXw2ST pTtj9IgXFn8cxw6XWtuYrXrrcgTBAGpFKmRzNIcjU8iusmn5vNiDuMn+NskzzLKa gwJvvtdvUXmYNgGEfzatL+V8eWG/qezEcu6p1SzpgImEOsK0IlG/kfytIFBl+O8F /gqFHNAicJKllcUrYJK+05boMfHTGB2sL9ZMyrbWu6hNmgpDZA4Xa2714YilATls YIfwYDNuvq0jQkShETbnEHX8n08ncEBPoxTU9oJAA8khl26Y2U7jBrun8KONg7rQ uhTmCXTGb3b1va/LcXEpHSjk8X7vmYjS9BQ8uanw/RFlitz/8lNdN/IZ8Qjimcmg K5MpX9D1O3yah4EDdx1vYQ751C5gqagLMW+iQqQptb5yYKznzM8vGaYuZsmRrGsU we6U72eE0mOnNOh4QN87MSmb0JU5Rc0Mxpu7mjdygL3VQZKzl46mazRl9z4wXkxe WrPrekhjZ95KEWn0OzXvKs7jVZY+CqyHYpWQalebT1YGFjE1/pIiX4eiJiozuhCo boK6LJljjfBwkRbQNGbl =7wYb -----END PGP SIGNATURE----- --Sig_/UoIQG1GhoXqqjKNl505DfSG--