Re: [PATCH] Omit User-Agent: header by default
[notmuch-archives.git] / 88 / 13d238ae31fff56685237a54c47901466ee1ee
1 Return-Path: <m.walters@qmul.ac.uk>\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 13798431FAF\r
6         for <notmuch@notmuchmail.org>; Sun,  9 Jun 2013 13:23:01 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id 8jBMmSTZU7YR for <notmuch@notmuchmail.org>;\r
17         Sun,  9 Jun 2013 13:22:51 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id EED08431FAE\r
22         for <notmuch@notmuchmail.org>; Sun,  9 Jun 2013 13:22:50 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1Ulm8S-00053s-TJ; Sun, 09 Jun 2013 21:22:47 +0100\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1Ulm8S-0005jS-IL; Sun, 09 Jun 2013 21:22:44 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH v2 1/7] cli: add --duplicate=N option to notmuch search\r
34 In-Reply-To:\r
35  <61ed86f221d65b4dba438cbc2b4c5b77a484a534.1370775663.git.jani@nikula.org>\r
36 References: <cover.1370775663.git.jani@nikula.org>\r
37         <61ed86f221d65b4dba438cbc2b4c5b77a484a534.1370775663.git.jani@nikula.org>\r
38 User-Agent: Notmuch/0.15.2+171~ge2f30a2 (http://notmuchmail.org) Emacs/23.4.1\r
39         (x86_64-pc-linux-gnu)\r
40 Date: Sun, 09 Jun 2013 21:22:42 +0100\r
41 Message-ID: <871u8b11bh.fsf@qmul.ac.uk>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 X-Sender-Host-Address: 93.97.24.31\r
45 X-QM-SPAM-Info: Sender has good ham record.  :)\r
46 X-QM-Body-MD5: 5887149924c26243538d1a921c1476d2 (of first 20000 bytes)\r
47 X-SpamAssassin-Score: -0.0\r
48 X-SpamAssassin-SpamBar: /\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
50         determine if it is\r
51         spam. We require at least 5.0 points to mark a message as spam.\r
52         This message scored -0.0 points.\r
53         Summary of the scoring: \r
54         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
55         provider *      (markwalters1009[at]gmail.com)\r
56         * -0.0 AWL AWL: From: address is in the auto white-list\r
57 X-QM-Scan-Virus: ClamAV says the message is clean\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Sun, 09 Jun 2013 20:23:01 -0000\r
71 \r
72 \r
73 Overall I like this series and am happy to give it a +1 as is but have a\r
74 few comments which might be worth considering.\r
75 \r
76 Is the order of filenames clear? eg is it the order that notmuch new met\r
77 them? In particular is duplicate=1 the oldest and duplicate=N the\r
78 newest? If so that might be worth mentioning in the manpage.\r
79 \r
80 On Sun, 09 Jun 2013, Jani Nikula <jani@nikula.org> wrote:\r
81 > Effective with --output=files, output the Nth filename associated with\r
82 > each message matching the query (N is 0-based). If N is equal to or\r
83 > greater than the number of files associated with the message, don't\r
84 > print anything.\r
85 > ---\r
86 >  notmuch-search.c |   18 ++++++++++++------\r
87 >  1 file changed, 12 insertions(+), 6 deletions(-)\r
88 >\r
89 > diff --git a/notmuch-search.c b/notmuch-search.c\r
90 > index 4323201..196934b 100644\r
91 > --- a/notmuch-search.c\r
92 > +++ b/notmuch-search.c\r
93 > @@ -177,7 +177,8 @@ do_search_messages (sprinter_t *format,\r
94 >                   notmuch_query_t *query,\r
95 >                   output_t output,\r
96 >                   int offset,\r
97 > -                 int limit)\r
98 > +                 int limit,\r
99 > +                 int dupe)\r
100 >  {\r
101 >      notmuch_message_t *message;\r
102 >      notmuch_messages_t *messages;\r
103 > @@ -206,14 +207,17 @@ do_search_messages (sprinter_t *format,\r
104 >       message = notmuch_messages_get (messages);\r
105 >  \r
106 >       if (output == OUTPUT_FILES) {\r
107 > +         int j;\r
108 >           filenames = notmuch_message_get_filenames (message);\r
109 >  \r
110 > -         for (;\r
111 > +         for (j = 1;\r
112 >                notmuch_filenames_valid (filenames);\r
113 > -              notmuch_filenames_move_to_next (filenames))\r
114 > +              notmuch_filenames_move_to_next (filenames), j++)\r
115 >           {\r
116 > -             format->string (format, notmuch_filenames_get (filenames));\r
117 > -             format->separator (format);\r
118 > +             if (dupe < 0 || dupe == j) {\r
119 > +                 format->string (format, notmuch_filenames_get (filenames));\r
120 > +                 format->separator (format);\r
121 \r
122 Is it deliberate that dupe == 0 is not covered? If my newest oldest\r
123 thing above is correct then maybe dupe == 0 could be the all option +N\r
124 the Nth oldest and -N the Nth newest. This may be not-trivial enough\r
125 it's not worth doing.\r
126 \r
127 > +             }\r
128 >           }\r
129 >           \r
130 >           notmuch_filenames_destroy( filenames );\r
131 > @@ -303,6 +307,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
132 >      int offset = 0;\r
133 >      int limit = -1; /* unlimited */\r
134 >      int exclude = EXCLUDE_TRUE;\r
135 > +    int dupe = -1;\r
136 >      unsigned int i;\r
137 >  \r
138 >      enum {\r
139 > @@ -339,6 +344,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
140 >                                    { 0, 0 } } },\r
141 >       { NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 },\r
142 >       { NOTMUCH_OPT_INT, &limit, "limit", 'L', 0  },\r
143 > +     { NOTMUCH_OPT_INT, &dupe, "duplicate", 'D', 0  },\r
144 >       { 0, 0, 0, 0, 0 }\r
145 >      };\r
146 >  \r
147 > @@ -424,7 +430,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
148 >       break;\r
149 >      case OUTPUT_MESSAGES:\r
150 >      case OUTPUT_FILES:\r
151 > -     ret = do_search_messages (format, query, output, offset, limit);\r
152 > +     ret = do_search_messages (format, query, output, offset, limit, dupe);\r
153 \r
154 Should there be an error message if duplicate=x is chosen with\r
155 output!=files?\r
156 \r
157 Best wishes\r
158 \r
159 Mark\r
160 \r
161 \r
162 >       break;\r
163 >      case OUTPUT_TAGS:\r
164 >       ret = do_search_tags (notmuch, format, query);\r
165 > -- \r
166 > 1.7.10.4\r
167 >\r
168 > _______________________________________________\r
169 > notmuch mailing list\r
170 > notmuch@notmuchmail.org\r
171 > http://notmuchmail.org/mailman/listinfo/notmuch\r