From: "W. Trevor King" <wking@tremily.us>
To: David Bremner <bremner@debian.org>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 2/4] nmbug: Handle missing @upstream in is_unmerged
Date: Tue, 15 Jul 2014 17:11:02 -0700 [thread overview]
Message-ID: <20140716001102.GG30232@odin> (raw)
In-Reply-To: <874myi89vu.fsf@maritornes.cs.unb.ca>
[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]
On Tue, Jul 15, 2014 at 08:44:53PM -0300, David Bremner wrote:
> W. Trevor King writes:
> > - my $fetch_head = git ('rev-parse', $commit);
> > + my ($fetch_head, $status) = git_with_status ('rev-parse', $commit);
> > + if ($status) {
> > + return 0;
> > + }
>
> 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: … (with a poor GIT_DIR config)
* fatal: ambiguous argument … (with an invalid/missing revision name)
* fatal: No upstream configured for branch … (when
branch.<name>.remote or branch.<name>.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 “No upstream configured for branch”
after we capture stderr with “nmbug: Catch stderr in is_unmerged” [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@tremily.us
http://article.gmane.org/gmane.mail.notmuch.general/18627
--
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-07-16 0:11 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-06 20:40 [PATCH 0/4] nmbug without an upstream repository (and init) W. Trevor King
2014-07-06 20:40 ` [PATCH 1/4] nmbug: Add a git_with_status helper function W. Trevor King
2014-07-16 9:36 ` David Bremner
2014-07-06 20:40 ` [PATCH 2/4] nmbug: Handle missing @upstream in is_unmerged W. Trevor King
2014-07-15 23:44 ` David Bremner
2014-07-16 0:11 ` W. Trevor King [this message]
2014-07-16 22:36 ` David Bremner
2014-07-16 23:03 ` W. Trevor King
2014-07-17 9:28 ` David Bremner
2014-07-17 18:38 ` W. Trevor King
2014-07-19 12:34 ` David Bremner
2014-07-06 20:40 ` [PATCH 3/4] nmbug: Catch stderr " W. Trevor King
2014-07-15 23:49 ` David Bremner
2014-07-16 0:17 ` W. Trevor King
2014-07-16 10:04 ` David Bremner
2014-07-06 20:40 ` [PATCH 4/4] nmbug: Add an 'init' command W. Trevor King
2014-07-15 23:54 ` David Bremner
2014-07-16 0:12 ` W. Trevor King
2014-09-15 16:13 ` David Edmondson
2014-09-15 16:25 ` W. Trevor King
2014-09-15 16:32 ` David Edmondson
2014-09-15 16:35 ` W. Trevor King
2014-09-15 18:09 ` David Bremner
2014-09-15 18:13 ` W. Trevor King
2014-09-23 18:44 ` [PATCH] potential fix for nmbug merge problems David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140716001102.GG30232@odin \
--to=wking@tremily.us \
--cc=bremner@debian.org \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).