database error
[notmuch-archives.git] / 8c / 059908954fcb7f7cf0bab5600f3cc6a6886f38
1 Return-Path: <tomi.ollila@iki.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 F2D7E431FD6\r
6         for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 10:22:35 -0800 (PST)\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 ij5ZMNJWp-0l for <notmuch@notmuchmail.org>;\r
16         Sun, 23 Feb 2014 10:22:23 -0800 (PST)\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 3A780431FCF\r
19         for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 10:22:22 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id A34ED100064;\r
22         Sun, 23 Feb 2014 20:21:59 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org,\r
25         Rob Browning <rlb@defaultvalue.org>\r
26 Subject: Re: [PATCH 0/3] check new.tags for invalid tags\r
27 In-Reply-To: <cover.1393174108.git.jani@nikula.org>\r
28 References: <87ha7qfto7.fsf@trouble.defaultvalue.org>\r
29         <cover.1393174108.git.jani@nikula.org>\r
30 User-Agent: Notmuch/0.17+94~g1b90823 (http://notmuchmail.org) Emacs/24.3.1\r
31         (x86_64-unknown-linux-gnu)\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
33         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
34         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
35 Date: Sun, 23 Feb 2014 20:21:59 +0200\r
36 Message-ID: <m21tytu1tk.fsf@guru.guru-group.fi>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Sun, 23 Feb 2014 18:22:36 -0000\r
52 \r
53 On Sun, Feb 23 2014, Jani Nikula <jani@nikula.org> wrote:\r
54 \r
55 > On Sun, 23 Feb 2014, Rob Browning <rlb@defaultvalue.org> wrote:\r
56 >> In the [new] section, "tags=;" will cause notmuch to create empty tags\r
57 >> that are fairly hard to remove from the command line.\r
58 >\r
59 > Clearly broken. This series fixes the issue at the cli\r
60 > level. (Forbidding empty tags at the lib level is slightly more\r
61 > complicated, as we would still have to ensure old dump files can be\r
62 > restored.)\r
63 >\r
64 >> After some help on #bup, here's what I came up with to remove them,\r
65 >> though it assumes that the empty tag "+ " will always be first in dump's\r
66 >> output:\r
67 >>\r
68 >>   notmuch dump --format=batch-tag 'tag:""' | perl -pe 's/^\+ //' \\r
69 >>     | notmuch restore --format=batch-tag\r
70 >>\r
71 >> And note that you have to use restore, "notmuch tag --batch" doesn't\r
72 >> appear to accept "- " as a tag, even though dump will produce "+ ".\r
73 >\r
74 > I didn't check this further, but the regular, non-batch notmuch tag\r
75 > should still work for removal of empty tags.\r
76 \r
77 LGTM.\r
78 \r
79 $ notmuch tag + -- id:edc2bc900f75bb2e72be2037e2df9105be7f0273.1393174108.git.jani@nikula.org\r
80 Error: empty tag forbiddenzsh: exit 1     notmuch tag + --\r
81 \r
82 $ notmuch restore --accumulate\r
83 + id:edc2bc900f75bb2e72be2037e2df9105be7f0273.1393174108.git.jani@nikula.org\r
84 <ctrl-d -- exit value 0> -- notmuch search shows space after ( to inform\r
85 there is empty tag.\r
86 \r
87 $ notmuch tag - -- id:edc2bc900f75bb2e72be2037e2df9105be7f0273.1393174108.git.jani@nikula.org\r
88 <no output -- exit value 0>\r
89 \r
90 notmuch search no longer shows space after (\r
91 \r
92 Also, SomeBody(tm) should add '\n' to the fprintf() in tag-util.c:175 (line\r
93 number after applying these patches).\r
94 \r
95 Tomi\r
96 \r
97 >\r
98 > BR,\r
99 > Jani.\r
100 >\r
101 > Jani Nikula (3):\r
102 >   cli: export function for illegal tag checking\r
103 >   cli: make sure notmuch new and insert don't add invalid tags\r
104 >   test: add tests for invalid new.tags\r
105 >\r
106 >  notmuch-insert.c    |  9 +++++++++\r
107 >  notmuch-new.c       | 14 +++++++++++++-\r
108 >  tag-util.c          |  9 +--------\r
109 >  tag-util.h          | 12 ++++++++++++\r
110 >  test/T050-new.sh    | 17 +++++++++++++++++\r
111 >  test/T070-insert.sh | 19 +++++++++++++++++++\r
112 >  6 files changed, 71 insertions(+), 9 deletions(-)\r
113 >\r
114 > -- \r
115 > 1.8.5.3\r
116 >\r
117 > _______________________________________________\r
118 > notmuch mailing list\r
119 > notmuch@notmuchmail.org\r
120 > http://notmuchmail.org/mailman/listinfo/notmuch\r