felipec / git-notmuch

Git remote helper for Notmuch mail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This tool allows dumping and loading notmuch metadata as if it were a git repository.

$ git clone "nm::$HOME/mail"

Each message-id is a directory, and the tags file contains the tags, for example:

% cat 20230328173932.3614601-1-felipe.contreras@gmail.com/tags
inbox
unread

To update the tags one can do the same as one does in a normal git repository:

% git pull

It’s easy to restore a previous state:

% git checkout @~10 -- .
% git commit -m 'go back to the state 10 commits ago'

Or manually edit the tags of a message:

% echo to-do >> 20230328173932.3614601-1-felipe.contreras@gmail.com/tags
% git commit -a -m 'add to-do tag'

And then push the local repository to the notmuch database:

% git push

All of the advantages of git commands are available, because it is in fact a git repository.

Install

Install the blake2b gem:

% gem install blake2b

Then add the git-remote-nm script anywhere in your $PATH, and make sure it’s executable.

You’ll also need notmuch Ruby bindings. You can check that you have them by running:

% ruby -e "require 'notmuch'"

That’s it.

About

Git remote helper for Notmuch mail


Languages

Language:Ruby 55.6%Language:Shell 44.4%