nmfirehose - a crude nmbug companion tool

Jani Nikula jani at nikula.org
Sat Mar 10 16:01:34 PST 2012


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?


BR,
Jani.

[1] http://nmbug.tethera.net/status/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nmfirehose
Type: application/octet-stream
Size: 5862 bytes
Desc: nmfirehose
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120311/b0cf503f/attachment.obj>


More information about the notmuch mailing list