commit message validation, or template commit form?

Matt Mackall mpm at selenic.com
Tue Dec 19 21:11:08 UTC 2006


On Tue, Dec 19, 2006 at 01:57:45PM -0600, Steve Borho wrote:
> On Tuesday 19 December 2006 9:20 am, Steve Borho wrote:
> > On Tuesday 19 December 2006 03:47, Georg wrote:
> > > Hi,
> > >
> > > I keep forgetting to supply some vital information, e.g. bug id
> > > references, in my commit messages.
> > >
> > > Is there a way to plug in some validation code for the commit
> > > message, e.g. some formal check whether a bug id was referenced? 
> > > I'm not after a bullet proof solution that validates ticket
> > > numbers, checks whether they are assigned to me etc., a simple
> > > syntactical check of the message would be sufficient.
> > >
> > > Acutally it would even help if hg commit (or qct, for that matter
> > > ;-) ) could present me with a default "fill in the blanks" kind of
> > > form when I commit.
> 
> Support for a commit message template is now on the qct tip.
> 
> == ~/.hgrc ==
> [ui]
> commit.template = /home/user/.commitLogTempl.txt
> 
> I thought about putting this in a [qct] section, but then decided that 
> other commit tools/scripts may want to support this in the future.  
> [ui] seemed the most appropriate place for it. 

<grumble>.

Let me just point out that having your template in ~ is a bit silly.
Because the template is likely to change per project, it ought to be
in the project root instead. 

It'd be better to make up a sensible default place to find the file
(like `hg root`/.commit.template).

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list