Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / ff / 55cdbdd5a3aefdbb8241fcaba3d17a4bb6ede5
1 Return-Path: <david@tethera.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 1EA1B431FC0\r
6         for <notmuch@notmuchmail.org>; Wed, 16 Jul 2014 03:04:31 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id uQ-Xmsx8J0LT for <notmuch@notmuchmail.org>;\r
16         Wed, 16 Jul 2014 03:04:23 -0700 (PDT)\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
18         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 78AFF431FBD\r
21         for <notmuch@notmuchmail.org>; Wed, 16 Jul 2014 03:04:23 -0700 (PDT)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <david@tethera.net>)\r
24         id 1X7M4U-0005SP-Th; Wed, 16 Jul 2014 07:04:22 -0300\r
25 Received: (nullmailer pid 6752 invoked by uid 1000); Wed, 16 Jul 2014\r
26         10:04:19 -0000\r
27 From: David Bremner <bremner@debian.org>\r
28 To: "W. Trevor King" <wking@tremily.us>\r
29 Subject: Re: [PATCH 3/4] nmbug: Catch stderr in is_unmerged\r
30 In-Reply-To: <20140716001730.GI30232@odin>\r
31 References: <cover.1404678709.git.wking@tremily.us>\r
32         <d55cf02465c5f2d83f2dd0bc666831ee524b0fb7.1404678709.git.wking@tremily.us>\r
33         <871ttm89nd.fsf@maritornes.cs.unb.ca> <20140716001730.GI30232@odin>\r
34 User-Agent: Notmuch/0.18.1+45~gf47eeac (http://notmuchmail.org) Emacs/24.3.1\r
35         (x86_64-pc-linux-gnu)\r
36 Date: Wed, 16 Jul 2014 07:04:19 -0300\r
37 Message-ID: <87y4vt8vrw.fsf@maritornes.cs.unb.ca>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain; charset=utf-8\r
40 Content-Transfer-Encoding: quoted-printable\r
41 Cc: notmuch@notmuchmail.org\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Wed, 16 Jul 2014 10:04:31 -0000\r
55 \r
56 "W. Trevor King" <wking@tremily.us> writes:\r
57 \r
58 >\r
59 > There should be standard Perl syntax for capturing both streams ;).  I\r
60 > can add a separate parameter instead, but Perl doesn't seem to have\r
61 > keyword-arguments.  At least, nmbug relies on assumptions about\r
62 > argument values:\r
63 >\r
64 >   sub git_pipe {\r
65 >     my $envref =3D (ref $_[0] eq 'HASH') ? shift : {};\r
66 >     my $ioref  =3D (ref $_[0] eq 'ARRAY') ? shift : undef;\r
67 >     my $dir =3D ($_[0] eq '-|' or $_[0] eq '|-') ? shift : undef;\r
68 >     =E2=80=A6\r
69 >   }\r
70 >\r
71 \r
72 Perl supports keyword arguments fine, by passing a single hash=20\r
73 to the subroutine. This particular sub doesn't do things that way, but\r
74 it's only called in three places, so it would be simple enough to change\r
75 the calling convention to to\r
76 \r
77 git_pipe (env =3D> {}, lines=3D>[],=20\r
78          command =3D> [  qw/diff-index --cached/,\r
79                  "--diff-filter=3D$filter", qw/--name-only HEAD/ ],\r
80          redirect =3D> [ whatever you want here ]=20=20=20=20=20=20=20=20=\r
81 =20=20=20=20=20=20=20=20=20\r
82          )\r
83 \r
84 \r
85 >  I'd be happy to rewrite nmbug in Python too, which has (to my eyes)\r
86 > much saner kwargs and subprocess handling.\r
87 \r
88 Although I think that's an extreme answer to this particular issue ;), I\r
89 do think it's worth discussing. In particular I think it would be\r
90 reasonable to consider an updated nmbug that used the python bindings to\r
91 notmuch, for possibly more speed. Of the people that currently work on\r
92 nmbug (I count myself, yourself, and Tomi), I think we're all ok with\r
93 python.  I know at least Jani mentioned he'd be more interested in\r
94 contributing to a python version.\r
95 \r
96 d\r
97 \r