[PATCH v2 0/6] batch tagging support: "notmuch tag --stdin"

Jani Nikula jani at nikula.org
Sat Apr 14 14:07:53 PDT 2012


Jameson Graef Rollins <jrollins at finestructure.net> writes:

> On Sat, Apr 14 2012, Jani Nikula <jani at nikula.org> wrote:
>> This series adds support for batch tagging through stdin to "notmuch
>> tag". This should be useful and efficient for e.g. initial tagging
>> scripts. Also, this adds locking around a batch of tag changes, which is
>> also useful for initial tagging scripts. See the test patch for an
>> example using a "here document".
>
> My issues from v1 still stand.  I would rather see some unification with
> the existing tag file format, rather than introduce a second format,
> with it's increased maintenance burden and confusion to users.  Either
> that or a more general batch command interface.

The existing dump/restore file format is a dead end. It fails
magnificently with tags and message-ids that have spaces or some other
special characters in them. It doesn't support removal of tags. There's
zero room for extensibility. I can't imagine how that could be used for
notmuch tag.

David originally wrote the dump/restore patches
id:"1324214111-32079-1-git-send-email-david at tethera.net" to add a
"notmuch" format (yes, a second format) in addition to the "sup" format
we currently have, to fix the issues with special characters. That too
lacked features to support batch tagging in notmuch new. The format
proposed here would fix the issues and work with notmuch tag, and it
would be obvious to use for anyone who has used notmuch tag.

I see a general batch command interface overkill. Too many problems to
solve for little gain (see the previous thread for details). What other
notmuch commands than tag would really benefit from it? If you want to
do search or show or whatever, the general batch command interface to
use is /bin/sh.

For notmuch tag, particularly in connection with notmuch new, there's a
clear benefit in having a batch mode: if you have "new" in new.tags, and
do initial tagging on the "new" tagged messages (e.g. in post-new hook),
you don't want anyone messing with the database while you're processing
the messages tagged "new". The batch tagging of this series keeps the db
locked for the duration of such initial tagging.

I'm totally fine with modifying the proposed format (e.g. change "T" to
"tag", make things compatible with a future general batch mode), but to
be absolutely clear: I will not implement a general batch command
mode. If that is deemed to be what is wanted, that's okay too. I can
share my WIP patches for dump/restore, and focus on something else.


BR,
Jani.


More information about the notmuch mailing list