notmuch-lazysync -- synchronizing tags using dropbox

2015-07-22 Thread David Bremner
David Mazieres  writes:

>
> When you have one mechanism (modtime) that solves multiple problems, it
> is likely the right thing to use...
>

someone (TM) just needs to review the patches at

id:1433525318-23756-1-git-send-email-david at tethera.net

d


Re: notmuch-lazysync -- synchronizing tags using dropbox

2015-07-22 Thread David Bremner
David Mazieres dm-list-email-notm...@scs.stanford.edu writes:


 When you have one mechanism (modtime) that solves multiple problems, it
 is likely the right thing to use...


someone (TM) just needs to review the patches at

id:1433525318-23756-1-git-send-email-da...@tethera.net

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


notmuch-lazysync -- synchronizing tags using dropbox

2015-07-21 Thread David Mazieres
Daniel Schoepe  writes:

> The way tag changes are logged is a bit of a hack, but it could be
> improved in the future by adding a post-tag hook to notmuch.

One thing to look into, if you are thinking of a better logging
mechanism, is that Xapian itself has a change logging mechanism for
replicating databases (http://xapian.org/docs/replication.html).

I do think it would be cleaner to do this in a way that is integrated
with notmuch, but I think the best way to do this is to integrate a
"modtime" value into the Xapian database.  Having a modtime for each
record would not only allow incremental transfers (just record the
highest timestamp sent to each replica), it would also solve this
terrible problem that in emacs you can end up tagging messages you don't
see (because you apply a tag to the query result, when new mail has come
in--which would be solved by tagging only through the higest modtime
actually displayed).

When you have one mechanism (modtime) that solves multiple problems, it
is likely the right thing to use...

David


notmuch-lazysync -- synchronizing tags using dropbox

2015-07-21 Thread Daniel Schoepe
Hi,

I needed a way to synchronize notmuch tags between machines without
having to sync all my mail as well (à la muchsync) and without using
Gmail labels for this. As a result, I ended up writing a small tool to
do this by using normal file synchronizers like seafile[1] or dropbox to
do the actual synchronization (since I was too lazy to (re)implement
this).

Since it's impractical to have the entire notmuch database synchronized
through dropbox, the tool uses a small sqlite database to record tag
commands performed on one machine and replay them on the others. This
works well if mail sorting is done on each machine separately and only
tag modifications performed in the frontend need to be recorded. The way
tag changes are logged is a bit of a hack, but it could be improved in
the future by adding a post-tag hook to notmuch.

More information can be found on github:

https://github.com/dschoepe/notmuch-lazysync

I hope someone else finds this useful as well.

Best regards,
Daniel

[1] https://www.seafile.com/en/home/
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-lazysync -- synchronizing tags using dropbox

2015-07-21 Thread David Mazieres
Daniel Schoepe dan...@schoepe.org writes:

 The way tag changes are logged is a bit of a hack, but it could be
 improved in the future by adding a post-tag hook to notmuch.

One thing to look into, if you are thinking of a better logging
mechanism, is that Xapian itself has a change logging mechanism for
replicating databases (http://xapian.org/docs/replication.html).

I do think it would be cleaner to do this in a way that is integrated
with notmuch, but I think the best way to do this is to integrate a
modtime value into the Xapian database.  Having a modtime for each
record would not only allow incremental transfers (just record the
highest timestamp sent to each replica), it would also solve this
terrible problem that in emacs you can end up tagging messages you don't
see (because you apply a tag to the query result, when new mail has come
in--which would be solved by tagging only through the higest modtime
actually displayed).

When you have one mechanism (modtime) that solves multiple problems, it
is likely the right thing to use...

David
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch