nmfirehose - a crude nmbug companion tool

Subject: nmfirehose - a crude nmbug companion tool

Date: Sun, 11 Mar 2012 02:01:34 +0200

To: notmuch@notmuchmail.org


From: Jani Nikula

Hi all -

There was some talk on IRC about maintaining a development branch
containing the "maybe ready" patches [1] to better expose them to
real-life use before merging to master.

I set out to automate this a little, and ended up with nmfirehose. It's
a shell script that can be used to grab a bunch of patches from the
notmuch mail store based on queries, and apply them to a repository. In
particular, it can grab the "maybe ready" patches and apply them against
notmuch master.

Inevitable conflicts are handled by applying patches in oldest first
order, and dropping any conflicting series. An email thread approximates
a patch series; more than one patch series in a thread are folded into
one series.

Patches are applied incrementally, on top of each other by default, but
there's also support for non-incremental per-series apply against master
to see if there are conflicts. This is useful for the "review"
query. Conflicting patches can be automatically tagged if so desired
(but I don't recommend pushing these to nmbug without human review).

How well any of this works very much depends on how accurately the patch
messages are tagged.

Some examples (run within a notmuch git repo, with up-to-date nmbug tags
in the database):

# take nmbug maybe-ready patches and apply them against origin/master
$ nmfirehose

# use local branch firehose and force use it even if existing
$ nmfirehose -l firehose -F

# keep going after conflicts without reverting whole series
$ nmfirehose -k

# check each series in review queue against master, and tag conflicting
$ nmfirehose -q review -n -t

# help
$ nmfirehose -h

I originally planned on putting this to cron and pushing the result
(supported out-of-the-box) to some public repo, but in the end I think
people can use this locally just as well, at the pace they want.

The script tries not to screw up anything in your notmuch repo, but be
careful nonetheless.

Script attached; comments welcome. Is this worth adding to contrib?


[1] http://nmbug.tethera.net/status/
nmfirehose (application/octet-stream)