--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id F2D7E431FD6\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 10:22:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id ij5ZMNJWp-0l for <notmuch@notmuchmail.org>;\r
+ Sun, 23 Feb 2014 10:22:23 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 3A780431FCF\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 10:22:22 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id A34ED100064;\r
+ Sun, 23 Feb 2014 20:21:59 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org,\r
+ Rob Browning <rlb@defaultvalue.org>\r
+Subject: Re: [PATCH 0/3] check new.tags for invalid tags\r
+In-Reply-To: <cover.1393174108.git.jani@nikula.org>\r
+References: <87ha7qfto7.fsf@trouble.defaultvalue.org>\r
+ <cover.1393174108.git.jani@nikula.org>\r
+User-Agent: Notmuch/0.17+94~g1b90823 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Sun, 23 Feb 2014 20:21:59 +0200\r
+Message-ID: <m21tytu1tk.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 23 Feb 2014 18:22:36 -0000\r
+\r
+On Sun, Feb 23 2014, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> On Sun, 23 Feb 2014, Rob Browning <rlb@defaultvalue.org> wrote:\r
+>> In the [new] section, "tags=;" will cause notmuch to create empty tags\r
+>> that are fairly hard to remove from the command line.\r
+>\r
+> Clearly broken. This series fixes the issue at the cli\r
+> level. (Forbidding empty tags at the lib level is slightly more\r
+> complicated, as we would still have to ensure old dump files can be\r
+> restored.)\r
+>\r
+>> After some help on #bup, here's what I came up with to remove them,\r
+>> though it assumes that the empty tag "+ " will always be first in dump's\r
+>> output:\r
+>>\r
+>> notmuch dump --format=batch-tag 'tag:""' | perl -pe 's/^\+ //' \\r
+>> | notmuch restore --format=batch-tag\r
+>>\r
+>> And note that you have to use restore, "notmuch tag --batch" doesn't\r
+>> appear to accept "- " as a tag, even though dump will produce "+ ".\r
+>\r
+> I didn't check this further, but the regular, non-batch notmuch tag\r
+> should still work for removal of empty tags.\r
+\r
+LGTM.\r
+\r
+$ notmuch tag + -- id:edc2bc900f75bb2e72be2037e2df9105be7f0273.1393174108.git.jani@nikula.org\r
+Error: empty tag forbiddenzsh: exit 1 notmuch tag + --\r
+\r
+$ notmuch restore --accumulate\r
++ id:edc2bc900f75bb2e72be2037e2df9105be7f0273.1393174108.git.jani@nikula.org\r
+<ctrl-d -- exit value 0> -- notmuch search shows space after ( to inform\r
+there is empty tag.\r
+\r
+$ notmuch tag - -- id:edc2bc900f75bb2e72be2037e2df9105be7f0273.1393174108.git.jani@nikula.org\r
+<no output -- exit value 0>\r
+\r
+notmuch search no longer shows space after (\r
+\r
+Also, SomeBody(tm) should add '\n' to the fprintf() in tag-util.c:175 (line\r
+number after applying these patches).\r
+\r
+Tomi\r
+\r
+>\r
+> BR,\r
+> Jani.\r
+>\r
+> Jani Nikula (3):\r
+> cli: export function for illegal tag checking\r
+> cli: make sure notmuch new and insert don't add invalid tags\r
+> test: add tests for invalid new.tags\r
+>\r
+> notmuch-insert.c | 9 +++++++++\r
+> notmuch-new.c | 14 +++++++++++++-\r
+> tag-util.c | 9 +--------\r
+> tag-util.h | 12 ++++++++++++\r
+> test/T050-new.sh | 17 +++++++++++++++++\r
+> test/T070-insert.sh | 19 +++++++++++++++++++\r
+> 6 files changed, 71 insertions(+), 9 deletions(-)\r
+>\r
+> -- \r
+> 1.8.5.3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r