[plt-dev] Commit logs and Gnats

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Apr 24 04:07:18 EDT 2010

I've added a hook that scans commit messages for PR mentions.
Currently, it's doing a simple job -- looks for two kinds of patterns
in these messages:

* mention pattern: PR 1234
  (or "pr 1234" or "Pr1234")

* closing pattern: closes PR 1234
  (or "closing", or "fixing", or "fixed")

When it encounters the first, then it examines the PR that is
mentioned, and will change the responsible to whoever pushed the
commit.  (Note: can be different from the git commiter -- that can be
any random email, and I can't get from there to a gnats user
reliably.)  The reason has a url that goes to the commit.  This should
also lead to a notification email about the change, which should also
reach the reporter.

But if the reponsible was already assigned (not "nobody"), then it
only adds a note in the audit trail -- again, with a link to the
commit.  Note that this does not send a notification (which seems
fine: don't annoy bug reporters etc).  Also note that the same happens
if the responsible is assigned to someone other than the pusher --
this might happen when X does a change that is related to Y's bug, and
id a change is needed then it should be done manually.

When it encounters a closing pattern, the PR is closed (and the
responsible is change if it's "nobody") with a note with the url.  If
the pattern was already closed, then it does the mention thing above.

This looks to me like it's useful enough, yet very simple.  The idea
is to not force people to remember some complex syntax -- it is easy
to extend this with more commands, but nobody will remember the
syntax.  AFAICT, this will often enough just do the right thing.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.