Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 70EDC431FC7 for ; Tue, 15 Jul 2014 17:11:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2JpD7mST2wrY for ; Tue, 15 Jul 2014 17:11:05 -0700 (PDT) Received: from qmta12.emeryville.ca.mail.comcast.net (qmta12.emeryville.ca.mail.comcast.net [76.96.27.227]) by olra.theworths.org (Postfix) with ESMTP id B4D6C431FC0 for ; Tue, 15 Jul 2014 17:11:05 -0700 (PDT) Received: from omta07.emeryville.ca.mail.comcast.net ([76.96.30.59]) by qmta12.emeryville.ca.mail.comcast.net with comcast id Smxo1o0051GXsuc01oB4w9; Wed, 16 Jul 2014 00:11:04 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta07.emeryville.ca.mail.comcast.net with comcast id SoB21o00R152l3L8UoB3H1; Wed, 16 Jul 2014 00:11:04 +0000 Received: by odin.tremily.us (Postfix, from userid 1000) id 3B8BF12951C5; Tue, 15 Jul 2014 17:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; t=1405469462; bh=PGp8ctgL0TGrS2I3am+TsMBelbccihS46DT5p1LM13M=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=nhmTbObCyMUBftpY02HftNf0jN4suvkwL//TcEqZF5W94zBB9+wQw4fPoW4/n0F2A zG2Vaa1L/DReOdvv5l7a3tlU9k+f8MncosBZHMi0FDz9SJirr+r+EDUZS63h+fUWQC UlVawrf1489WIe4kqid4jm30bbAeU40JEaGQkhyc= Date: Tue, 15 Jul 2014 17:11:02 -0700 From: "W. Trevor King" To: David Bremner Subject: Re: [PATCH 2/4] nmbug: Handle missing @upstream in is_unmerged Message-ID: <20140716001102.GG30232@odin> References: <874myi89vu.fsf@maritornes.cs.unb.ca> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nqkreNcslJAfgyzk" Content-Disposition: inline In-Reply-To: <874myi89vu.fsf@maritornes.cs.unb.ca> OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8; url=http://tremily.us/pubkey.txt User-Agent: Mutt/1.5.23 (2014-03-12) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1405469464; bh=cNe6mQ4E5JpwaiDkUtSzOR8af1KhWD04CGwBY5WJu/A=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=HuXFxlt6Txk6nueR8Mum4c2fMywa2JDRcN4aAHsdVvxrAhbpeFdP+YdXIb8sSR7eP wyqL5sRE6fZobt2Lmt4//gv/VeXOKYmjKKklqXxMNN66hp2wK/GNDXvCctExhDVXOP TbNpUsQbRhdKMdh/qBXuq9k6uprmodBKepaACLmccgynpYkTEmRw7Lo2CX74iDUTje mgBKjx+vGyyArUBXCLDM1BbHUu3EEzJovP2zCm+Q948KTsNmsUPJmfwx+0fEnpc/LR IN0Ik/2SC1dmCw0XQf3kTDmQeHJfHVf389JAqsImb6S7aCMSYqm4S2MR65VAVIurs7 fk7GzDo+sYMcQ== Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 00:11:09 -0000 --nqkreNcslJAfgyzk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 15, 2014 at 08:44:53PM -0300, David Bremner wrote: > W. Trevor King writes: > > - my $fetch_head =3D git ('rev-parse', $commit); > > + my ($fetch_head, $status) =3D git_with_status ('rev-parse', $commit); > > + if ($status) { > > + return 0; > > + } >=20 > Could there be other errors here, other than @{upstream} not > existing? At first glance it seems like there is potential to hide > errors here. Possible errors that I can find: * fatal: Not a git repository: =E2=80=A6 (with a poor GIT_DIR config) * fatal: ambiguous argument =E2=80=A6 (with an invalid/missing revision nam= e) * fatal: No upstream configured for branch =E2=80=A6 (when branch..remote or branch..merge aren't set) All of which return 128 as of Git v1.9.1. We're only interested in the last. I'm fine looking for =E2=80=9CNo upstream configured for branch= =E2=80=9D after we capture stderr with =E2=80=9Cnmbug: Catch stderr in is_unmerged=E2= =80=9D [1], but I don't expect the other two error cases to happen very often. At least, I doubt you could get this far into do_status with a broken GIT_DIR, and we're hard-coding '@{upstream}' here. Cheers, Trevor [1]: id:d55cf02465c5f2d83f2dd0bc666831ee524b0fb7.1404678709.git.wking@tremi= ly.us http://article.gmane.org/gmane.mail.notmuch.general/18627 --=20 This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy --nqkreNcslJAfgyzk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTxcMUAAoJEG8/JgBt8ol8mSYP/RXAhtEQ8KdL7nqo/Q2VpNhQ s7wxanlzA4TmQ9ABQAtp5HlmpOo+4znMB8pD3DleHUDVIEIvCTjKdPVMI1ip4Ig3 UfUoRwniFZcIGoR/wwtTi7im+9BQHIdvwj/mUpYM8iqGPOijEbPuWvtENJv9enOa XIcI4RDLFwqwmXjyz0pP4jvO63ZuVUkywZXhEnpljSezLCIwMOG9+EhUHQM+Q4lM MDRaVmq3ORFYKsOuhXFitTBP1CNjx0YOYkOHdRfTeNqDVnXkqIjnfMf/iIP9KKql bSyCkbqRtvbRtR1IomSETCSOr6G7z9huhFKfirIXdY0mS849UW4l8pggFtMjRF3G 9QNMRyI1hIoIl6k8GBEhRAN0yWNEyhStha/16ZUIBJZ/bYo1xpOsKiSLhSVv7o7Q N0zqbNzwAiYWJBTtYjKYfK2o65nTJQ2DhqkSNkbue1WGXhqXXQpkFFXBbNEzQQlk 6q8fr47CMyDVldOh5719pKcu2Fm+05VgbYlPLq2rr3dFxTBBDsQ+KFdWtVl/vx8B VqXkpnPUi8/ppMTXvIZBxXLpdCRyMX2ZYjJvs4RA/JYmIbPGdfBObExez1UH7e1Y cNjoXSD5/3GyRnVsDC4dfXmGb6FpemmWA3E68NESuEDsSrwDJndKhfR28cL7T+ve SecxTNpwbcdMYtPeztDz =9aiG -----END PGP SIGNATURE----- --nqkreNcslJAfgyzk--