Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / e9 / 22f1b20df90ee697bf30b09907bd4934f97fa4
1 Return-Path: <too@guru-group.fi>\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 123F0431FBD\r
6         for <notmuch@notmuchmail.org>; Fri, 31 May 2013 12:10:43 -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 RfFAJ-t0HkGg for <notmuch@notmuchmail.org>;\r
16         Fri, 31 May 2013 12:10:35 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 28B07431FC7\r
19         for <notmuch@notmuchmail.org>; Fri, 31 May 2013 12:10:35 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 9110910009D; Fri, 31 May 2013 22:10:34 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [RFC PATCH] revert: Removed top level --stderr= option\r
25 Date: Fri, 31 May 2013 22:10:31 +0300\r
26 Message-Id: <1370027431-16018-1-git-send-email-tomi.ollila@iki.fi>\r
27 X-Mailer: git-send-email 1.8.0\r
28 Cc: tomi.ollila@iki.fi\r
29 X-BeenThere: notmuch@notmuchmail.org\r
30 X-Mailman-Version: 2.1.13\r
31 Precedence: list\r
32 List-Id: "Use and development of the notmuch mail system."\r
33         <notmuch.notmuchmail.org>\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
35         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
37 List-Post: <mailto:notmuch@notmuchmail.org>\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
41 X-List-Received-Date: Fri, 31 May 2013 19:10:43 -0000\r
42 \r
43 While looked good on paper, its attempted use caused confusion, complexity,\r
44 and potential for information leak when passed through wrapper scripts.\r
45 For slimmer code and to lessen demand for maintenance/support the set of\r
46 commits which added top level --stderr= option is now reverted.\r
47 ---\r
48 \r
49 Change was easy, commit message hard. Opinions? Revert is easiest to do now.\r
50 Also, if someone comes with a novel idea how to utilize --stderr option\r
51 please tell it now -- I'd be most eager to hear it :D\r
52 \r
53 \r
54 This change was done the following way:\r
55 \r
56 $ git checkout -b rvrt b9020448bd\r
57 $ git reset --hard HEAD^^^^\r
58 $ git reset b9020448bd\r
59 $ git commit -a\r
60 $ git diff HEAD~5..HEAD\r
61 \r
62 (last one to reveal HEAD~5 & HEAD have identical trees).\r
63 \r
64 Question why:\r
65 id:20130521195549.6550.53636@thinkbox.jade-hamburg.de\r
66 \r
67 Good reason why not:\r
68 id:1369934016-22308-1-git-send-email-amdragon@mit.edu\r
69 \r
70 \r
71  NEWS               |  5 -----\r
72  man/man1/notmuch.1 |  7 -------\r
73  notmuch-client.h   |  1 -\r
74  notmuch.c          | 32 --------------------------------\r
75  test/help-test     |  9 ---------\r
76  5 files changed, 54 deletions(-)\r
77 \r
78 diff --git a/NEWS b/NEWS\r
79 index 80abd97..a7f2ec6 100644\r
80 --- a/NEWS\r
81 +++ b/NEWS\r
82 @@ -35,11 +35,6 @@ Top level option to specify configuration file\r
83    It's now possible to specify the configuration file to use on the\r
84    command line using the `notmuch --config=FILE` option.\r
85  \r
86 -Top level option to redirect writes to stderr\r
87 -\r
88 -  With `notmuch --stderr=FILE` all writes to stderr are redirected to\r
89 -  the specified file. If FILE is '-', stderr is redirected to stdout.\r
90 -\r
91  Deprecated commands "part" and "search-tags" are removed.\r
92  \r
93  Bash command-line completion\r
94 diff --git a/man/man1/notmuch.1 b/man/man1/notmuch.1\r
95 index f5ca0ad..033cc10 100644\r
96 --- a/man/man1/notmuch.1\r
97 +++ b/man/man1/notmuch.1\r
98 @@ -76,14 +76,7 @@ Print the installed version of notmuch, and exit.\r
99  \r
100  Specify the configuration file to use. This overrides any\r
101  configuration file specified by ${NOTMUCH_CONFIG}.\r
102 -.RE\r
103 -\r
104 -.RS 4\r
105 -.TP 4\r
106 -.B \-\-stderr=FILE\r
107  \r
108 -Redirect all writes to stderr to the specified file.\r
109 -If FILE is '-', stderr is redirected to stdout.\r
110  .RE\r
111  \r
112  .SH COMMANDS\r
113 diff --git a/notmuch-client.h b/notmuch-client.h\r
114 index 4a3c7ac..45749a6 100644\r
115 --- a/notmuch-client.h\r
116 +++ b/notmuch-client.h\r
117 @@ -54,7 +54,6 @@ typedef GMimeCipherContext notmuch_crypto_context_t;\r
118  #include <sys/stat.h>\r
119  #include <sys/time.h>\r
120  #include <unistd.h>\r
121 -#include <fcntl.h>\r
122  #include <dirent.h>\r
123  #include <errno.h>\r
124  #include <signal.h>\r
125 diff --git a/notmuch.c b/notmuch.c\r
126 index 15e90c8..f51a84f 100644\r
127 --- a/notmuch.c\r
128 +++ b/notmuch.c\r
129 @@ -251,32 +251,6 @@ notmuch_command (notmuch_config_t *config,\r
130      return 0;\r
131  }\r
132  \r
133 -static int\r
134 -redirect_stderr (const char * stderr_file)\r
135 -{\r
136 -    if (strcmp (stderr_file, "-") == 0) {\r
137 -       if (dup2 (STDOUT_FILENO, STDERR_FILENO) < 0) {\r
138 -           perror ("dup2");\r
139 -           return 1;\r
140 -       }\r
141 -    } else {\r
142 -       int fd = open (stderr_file, O_WRONLY|O_CREAT|O_TRUNC, 0666);\r
143 -       if (fd < 0) {\r
144 -           fprintf (stderr, "Error: Cannot redirect stderr to '%s': %s\n",\r
145 -                    stderr_file, strerror (errno));\r
146 -           return 1;\r
147 -       }\r
148 -       if (fd != STDERR_FILENO) {\r
149 -           if (dup2 (fd, STDERR_FILENO) < 0) {\r
150 -               perror ("dup2");\r
151 -               return 1;\r
152 -           }\r
153 -           close (fd);\r
154 -       }\r
155 -    }\r
156 -    return 0;\r
157 -}\r
158 -\r
159  int\r
160  main (int argc, char *argv[])\r
161  {\r
162 @@ -285,7 +259,6 @@ main (int argc, char *argv[])\r
163      const char *command_name = NULL;\r
164      command_t *command;\r
165      char *config_file_name = NULL;\r
166 -    char *stderr_file = NULL;\r
167      notmuch_config_t *config;\r
168      notmuch_bool_t print_help=FALSE, print_version=FALSE;\r
169      int opt_index;\r
170 @@ -295,7 +268,6 @@ main (int argc, char *argv[])\r
171         { NOTMUCH_OPT_BOOLEAN, &print_help, "help", 'h', 0 },\r
172         { NOTMUCH_OPT_BOOLEAN, &print_version, "version", 'v', 0 },\r
173         { NOTMUCH_OPT_STRING, &config_file_name, "config", 'c', 0 },\r
174 -       { NOTMUCH_OPT_STRING, &stderr_file, "stderr", '\0', 0 },\r
175         { 0, 0, 0, 0, 0 }\r
176      };\r
177  \r
178 @@ -315,10 +287,6 @@ main (int argc, char *argv[])\r
179         return 1;\r
180      }\r
181  \r
182 -    if (stderr_file && redirect_stderr (stderr_file) != 0) {\r
183 -       /* error already printed */\r
184 -       return 1;\r
185 -    }\r
186      if (print_help)\r
187         return notmuch_help_command (NULL, argc - 1, &argv[1]);\r
188  \r
189 diff --git a/test/help-test b/test/help-test\r
190 index bd0111c..f7df725 100755\r
191 --- a/test/help-test\r
192 +++ b/test/help-test\r
193 @@ -9,13 +9,4 @@ test_expect_success 'notmuch help' 'notmuch help'\r
194  test_expect_success 'notmuch help tag' 'notmuch help tag'\r
195  test_expect_success 'notmuch --version' 'notmuch --version'\r
196  \r
197 -test_begin_subtest "notmuch --stderr=stderr help %"\r
198 -notmuch --stderr=stderr help %\r
199 -test_expect_equal "$(cat stderr)" "\r
200 -Sorry, % is not a known command. There's not much I can do to help."\r
201 -\r
202 -test_begin_subtest "notmuch --stderr=- help %"\r
203 -test_expect_equal "$(notmuch --stderr=- help %)" "\r
204 -Sorry, % is not a known command. There's not much I can do to help."\r
205 -\r
206  test_done\r
207 -- \r
208 1.8.0\r
209 \r