Example start_commit/pre_commit hook that modifies commit message

Patrick Doyle wpdster at gmail.com
Thu Aug 15 12:33:07 UTC 2013


Thanks.  I'll have a look at that.  I suspect it won't be quite what I want
(because it seems like it will construct a default commit message ready to
be edited with my editor).  I typically follow a "commit early, commit
often" style of working on topic branches (and private projects).  As such,
I like to write one-line commit messages right on the command line.  It
would be nice if I could add some automation to my workflow to prepend a
"[PASSED]" or "[FAILED]" string to the commit message I scribble out on the
command line.

So I'll keep commitfromnews in mind.  Perhaps I'll change my workflow to
write my commit messages in my IDE (Emacs) instead of at the command line.

--wpd



On Wed, Aug 14, 2013 at 10:42 PM, Robert Collins
<robertc at robertcollins.net>wrote:

> On 15 August 2013 14:11, Patrick Doyle <wpdster at gmail.com> wrote:
> >
> > I would like to write a start_commit or pre_commit hook that modifies my
> commit message.  Can anybody point me at an example of a hook that does
> this?
> >
> > If you're interested in more details, I am following a test driven
> development process, and would like to automatically run my unit tests on
> every commit.  I would like automatically edit my commit message to reflect
> whether this particular commit passes all of my unit tests or fails one or
> more of them.
> >
> > So I guess a broader question might be, does anybody think this is a
> good idea?
> >
> > (Since this is for a private development process, I'm the only person
> that would benefit or be harmed by this idea.  For a shared, public
> development process, I might be interested in implementing this idea on my
> private topic branches, but, obviously, would only want to publish results
> for which unit tests passed.)
>
> The commitfromnews plugin does something similar - it puts the items
> from NEWS into the default commit message.
>
> -Rob
>
>
>
> --
> Robert Collins <rbtcollins at hp.com>
> Distinguished Technologist
> HP Converged Cloud
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20130815/d9d63161/attachment.html>


More information about the bazaar mailing list