From 5768bace4b6495c0a415c9b9ffddb3e2f9532224 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 10 Jan 2016 22:51:32 +2000 Subject: [PATCH] WIP: add metadata to dump output --- 69/78ffa140deb7aac427bb49c101a8bf7010800a | 77 +++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 69/78ffa140deb7aac427bb49c101a8bf7010800a diff --git a/69/78ffa140deb7aac427bb49c101a8bf7010800a b/69/78ffa140deb7aac427bb49c101a8bf7010800a new file mode 100644 index 000000000..af5d0c129 --- /dev/null +++ b/69/78ffa140deb7aac427bb49c101a8bf7010800a @@ -0,0 +1,77 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 3F2536DE02C9 + for ; Sat, 9 Jan 2016 18:51:57 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.311 +X-Spam-Level: +X-Spam-Status: No, score=-0.311 tagged_above=-999 required=5 tests=[AWL=0.240, + RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id lX7b7FVtuKJw for ; + Sat, 9 Jan 2016 18:51:55 -0800 (PST) +Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) + by arlo.cworth.org (Postfix) with ESMTPS id 791156DE01D3 + for ; Sat, 9 Jan 2016 18:51:53 -0800 (PST) +Received: from remotemail by fethera.tethera.net with local (Exim 4.84) + (envelope-from ) id 1aI66X-0007Cp-N3 + for notmuch@notmuchmail.org; Sat, 09 Jan 2016 21:51:41 -0500 +Received: (nullmailer pid 29635 invoked by uid 1000); + Sun, 10 Jan 2016 02:51:47 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: WIP: add metadata to dump output +Date: Sat, 9 Jan 2016 22:51:32 -0400 +Message-Id: <1452394301-29499-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.6.4 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 10 Jan 2016 02:51:57 -0000 + +It seems (at least to me) that xapian metadata is the right way store +certain configuration data, including tag aliases [1] and perhaps some +non-CLI specific configuration. On the other hand we don't want to +have things lost if we dump and restore a database. Hence this series, +which is a start at dumping and restore such config. + +The main idea here is that various classes of metadata can be defined +by using prefixes, in exactly the same way as tags are defined for +documents. This will hopefully help prevent e.g. config from stomping +on tag aliases. + +The first 6 patches impliment iterators for simple "queries" on +metadata. They are probably split a bit fine, but that's the way I +developed them. + +The last 3 impliment the printing of metadata in dump output. In order +to be upwardly compatible, it uses the old dodge of hiding things in +comments. In fact the comment syntax (# in first column) was never +well documented; this does mean that the notmuch dump output can be +tested without breaking the current restore tests. I threw an @ in to +help autodetection of formats; obviously this is not foolproof. On the +other hand, I don't know how much people currently rely on comments in +dump files, since notmuch doesn't generate them. + +There's lots of bikes to shed here. Probably the most important bits +are the library API, the dump output format, and of course the ever +tricky command line argument names. + +Getting the memory ownership semantics is tricky, especially with the +mix of C++ objects and talloc. So I'd appreciate a critical eye on +those bits of metadata.cc. + +[1]: id:1448504191-30974-1-git-send-email-igor.contato@gmail.com -- 2.26.2