unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <bremner@debian.org>
To: "W. Trevor King" <wking@tremily.us>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 3/4] nmbug: Catch stderr in is_unmerged
Date: Wed, 16 Jul 2014 07:04:19 -0300	[thread overview]
Message-ID: <87y4vt8vrw.fsf@maritornes.cs.unb.ca> (raw)
In-Reply-To: <20140716001730.GI30232@odin>

"W. Trevor King" <wking@tremily.us> writes:

>
> There should be standard Perl syntax for capturing both streams ;).  I
> can add a separate parameter instead, but Perl doesn't seem to have
> keyword-arguments.  At least, nmbug relies on assumptions about
> argument values:
>
>   sub git_pipe {
>     my $envref = (ref $_[0] eq 'HASH') ? shift : {};
>     my $ioref  = (ref $_[0] eq 'ARRAY') ? shift : undef;
>     my $dir = ($_[0] eq '-|' or $_[0] eq '|-') ? shift : undef;
>     …
>   }
>

Perl supports keyword arguments fine, by passing a single hash 
to the subroutine. This particular sub doesn't do things that way, but
it's only called in three places, so it would be simple enough to change
the calling convention to to

git_pipe (env => {}, lines=>[], 
         command => [  qw/diff-index --cached/,
		 "--diff-filter=$filter", qw/--name-only HEAD/ ],
         redirect => [ whatever you want here ]                 
         )


>  I'd be happy to rewrite nmbug in Python too, which has (to my eyes)
> much saner kwargs and subprocess handling.

Although I think that's an extreme answer to this particular issue ;), I
do think it's worth discussing. In particular I think it would be
reasonable to consider an updated nmbug that used the python bindings to
notmuch, for possibly more speed. Of the people that currently work on
nmbug (I count myself, yourself, and Tomi), I think we're all ok with
python.  I know at least Jani mentioned he'd be more interested in
contributing to a python version.

d

  reply	other threads:[~2014-07-16 10:04 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
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 [this message]
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=87y4vt8vrw.fsf@maritornes.cs.unb.ca \
    --to=bremner@debian.org \
    --cc=notmuch@notmuchmail.org \
    --cc=wking@tremily.us \
    /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).