On Thu, 05 Jan 2012 23:39:30 -0400, David Bremner <david@tethera.net> wrote: > > 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. > > maybe the branches could be under some namespace that makes this easy? Just a prefix? 'review/' or something? > > +(defvar notmuch-dev-temporary-repository-name (concat "notmuch-dev-" (user-login-name)) > > + "The name of the temporary repository.") > > Do we care about security at all in this context? I'm always a bit > nervous about creating predictably named files/directories in publicly > writable places. I presume that you'd already have set `temporary-file-directory' if you worry about this generally, or `notmuch-dev-temporary-directory' if just in this instance. > > + ;; Causes us to switch to the magit buffer - is that unfortunate in > > + ;; some situations? > > + (magit-status notmuch-dev-temporary-repository-path)) > > I found it to be a pleasant surprise. Ending there when the whole sequence completes, I agree. The question is really about whether displaying the magit-status buffer after simply creating the repository is good. > > + (shell-command > > + (concat > > + notmuch-command " show --format=mbox " (shell-quote-argument search-terms) > > + " | " > > + "git am --quiet")) > > + > > Hmm. A knee jerk reaction is not to like this, like seeing system in C > code. But I don't have a better solution off hand. Agreed. I think that I'll split it into two parts: - running notmuch to create a mailbox (or perhaps directory of patches), - running git-am to apply the patches. A bigger problem is that magit appears to be ignorant of git-am, with the result that if applying the patches fails magit doesn't provide any help (or even notification) that there are outstanding things to do. It also blocks a future git-am. Currently thinking about an alternative to using git-am that is more magit friendly...