[PATCH] emacs: Helpers for notmuch developers.

Tomi Ollila tomi.ollila at iki.fi
Fri Jan 6 14:56:19 PST 2012


On Wed,  4 Jan 2012 14:01:18 +0000, David Edmondson <dme at dme.org> wrote:
> ---
> 
> I've been using this for a few days and decided to share it to get
> feedback. Reviewing patches can be tedious, so I tried to make things
> a little simpler.
> 
> To use this, load the file and then from `notmuch-show-mode' invoke
> `notmuch-dev-show-review-patch'. It assumes that any open messages
> contain patches and attempts to build a repository with the patches
> applied.
> 
> General management (i.e. keeping up to date) of the repository it uses
> is your responsibility, as is cleaning out old branches. You can, of
> course, just delete the temporary repository after using it - the code
> will re-create it next time.
> 
> If you have a slow network connection then a local copy of the main
> repository can be specified by changing
> `notmuch-dev-master-repository'.
> 
> Comments?

I think this is great. I've worked on something related but the emacs MUA
"integration" makes patching simpler (My thing worked on shell and would
require a 'recipe' file to describe HEAD commit and patch message id:s).

What I've done differently is that I already have cloned notmuch repository
somewhere which I attempt to keep up-to-date. For repository which I'm
going to patch I first do:

git clone --local --shared --no-checkout /path/to/notmuch/repo notmuch-dev-$USER
git --git-dir notmuch-dev-$USER/.git' config --unset remote.origin.url
cd notmuch-dev-$USER
git checkout -b patched $commit

I.e.

1) I created a local repository clone, sharing objects without initial checkout.
2) removed "remote" origin so accidental pushes are not possible
3) checkout out tree from some commit (possible not remote HEAD) 

And this is done every time before new patchset is applied -- always on top
of clean working directory.

What do you think of this approach related to your way cloning the repo and
then deleting/creating the branch. Just that developer may mess with the
repository contents and then there is tedious working tree cleanup to be
done (especially those who are not so fluent using git).


Tomi



More information about the notmuch mailing list