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
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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
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
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
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
54 This change was done the following way:
\r
56 $ git checkout -b rvrt b9020448bd
\r
57 $ git reset --hard HEAD^^^^
\r
58 $ git reset b9020448bd
\r
60 $ git diff HEAD~5..HEAD
\r
62 (last one to reveal HEAD~5 & HEAD have identical trees).
\r
65 id:20130521195549.6550.53636@thinkbox.jade-hamburg.de
\r
67 Good reason why not:
\r
68 id:1369934016-22308-1-git-send-email-amdragon@mit.edu
\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
78 diff --git a/NEWS b/NEWS
\r
79 index 80abd97..a7f2ec6 100644
\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
86 -Top level option to redirect writes to stderr
\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
91 Deprecated commands "part" and "search-tags" are removed.
\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
100 Specify the configuration file to use. This overrides any
\r
101 configuration file specified by ${NOTMUCH_CONFIG}.
\r
106 -.B \-\-stderr=FILE
\r
108 -Redirect all writes to stderr to the specified file.
\r
109 -If FILE is '-', stderr is redirected to stdout.
\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
124 #include <signal.h>
\r
125 diff --git a/notmuch.c b/notmuch.c
\r
126 index 15e90c8..f51a84f 100644
\r
129 @@ -251,32 +251,6 @@ notmuch_command (notmuch_config_t *config,
\r
134 -redirect_stderr (const char * stderr_file)
\r
136 - if (strcmp (stderr_file, "-") == 0) {
\r
137 - if (dup2 (STDOUT_FILENO, STDERR_FILENO) < 0) {
\r
142 - int fd = open (stderr_file, O_WRONLY|O_CREAT|O_TRUNC, 0666);
\r
144 - fprintf (stderr, "Error: Cannot redirect stderr to '%s': %s\n",
\r
145 - stderr_file, strerror (errno));
\r
148 - if (fd != STDERR_FILENO) {
\r
149 - if (dup2 (fd, STDERR_FILENO) < 0) {
\r
160 main (int argc, char *argv[])
\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
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
178 @@ -315,10 +287,6 @@ main (int argc, char *argv[])
\r
182 - if (stderr_file && redirect_stderr (stderr_file) != 0) {
\r
183 - /* error already printed */
\r
187 return notmuch_help_command (NULL, argc - 1, &argv[1]);
\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
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
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