]> git.notmuchmail.org Git - notmuch/commit
contrib/nmbug: new script for sharing tags with a given prefix.
authorDavid Bremner <bremner@debian.org>
Sun, 13 Nov 2011 01:24:25 +0000 (21:24 -0400)
committerDavid Bremner <bremner@debian.org>
Sun, 13 Nov 2011 01:24:25 +0000 (21:24 -0400)
commitebd1adc55bcd0f484984bb87f0ea5c0e7091d062
tree0705ca92226925b459b6771aee29a88044bc0fd1
parent9207f90f525cde1e3f5c4695eb5b59c53b4a01ca
contrib/nmbug: new script for sharing tags with a given prefix.

The main idea is consider the notmuch database as analogous to the
work-tree. A bare git repo is maintained in the users home directory,
with a tree of the form tags/$message-id/$tag

Like notmuch and git, we have a set of subcommnds, mainly modelled on
git.

Implementation wise, the heavy lifting is in the following functions.

   commit xapian -> git
   checkout git -> xapian
   merge fetched git + git -> xapian
   status find differences between xapian, git, and remote git.

The central implementation trick, from an idea I think due to
tomprince on IRC is manipulate the git index directly from the xapian
tag information.  The merge routine is still done using a temporary
checkout as I wasn't able to get it working with the index only.

There are also some convenience wrappers around git commands, like "fetch"
that essential just set GIT_DIR in the environment.

In order to encode tags (viewed as octet sequences) into filenames,
we whitelist a smallish set of characters and %hex escape anything outside.

The prefix is omitted in git, which lets one save and restore to
different prefixes (although this is only lightly tested).

Thanks to Tomi Ollila for a huge amount of feedback and patches while
putting this together.
contrib/nmbug [new file with mode: 0755]