unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* WIP: add metadata to dump output
@ 2016-01-10  2:51 David Bremner
  2016-01-10  2:51 ` [WIP patch 1/9] lib: initial API for prefixed metadata David Bremner
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: David Bremner @ 2016-01-10  2:51 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-01-10 14:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-10  2:51 WIP: add metadata to dump output David Bremner
2016-01-10  2:51 ` [WIP patch 1/9] lib: initial API for prefixed metadata David Bremner
2016-01-10  2:51 ` [WIP patch 2/9] lib: notmuch_metadata_t: iterators for metadata David Bremner
2016-01-10  2:51 ` [WIP patch 3/9] lib: add and test function to retrive current key David Bremner
2016-01-10  2:51 ` [WIP patch 4/9] lib: add and test function to retrieve current metadata value David Bremner
2016-01-10  2:51 ` [WIP patch 5/9] lib: add notmuch_metadata_move_to_next David Bremner
2016-01-10  2:51 ` [WIP patch 6/9] lib: add notmuch_metadata_destroy David Bremner
2016-01-10  2:51 ` [WIP patch 7/9] CLI: add print_status_database David Bremner
2016-01-10  2:51 ` [WIP patch 8/9] lib: make string representation of metadata class public David Bremner
2016-01-10  2:51 ` [WIP patch 9/9] CLI: add optional metadata to dump output David Bremner
2016-01-10 14:36 ` WIP: add " Tomi Ollila

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).