Validating commit message in central repository
Haszlakiewicz, Eric
EHASZLA at transunion.com
Wed Oct 20 16:49:47 UTC 2010
>-----Original Message-----
>From: mercurial-bounces at selenic.com
[mailto:mercurial-bounces at selenic.com]
>
>I have a requirement to validate all commit messages for a particular
>Mercurial repository (i.e. the commit messages must conform to a
certain
>format). As we are using a central repository, we plan to create a
"pre"
>hook in the central repository that will ensure all changesets being
added
>to the central repository have commit messages that conform to our
>standard. We will also provide hooks to all our developers for their
local
>repositories so that they enter valid commit messages in their local
>repositories. But, say a developer has not installed a hook in their
local
>repository and successfully commits a change to their local repository
with
>an invalid commit message. When this developer tries to push to the
>central repository, the push will fail. The developer now realises
his/her
>mistake and realises they need to enter a valid commit message. My
>question is this: How can this developer get his/her changes into the
>central repository at this stage? Is there a tool or function that
allows
>them to add a retrospective comment? Or is there some other solution?
Mercurial makes it very hard to change anything about a changeset after
it's been committed. To actually adjust the message you're best bet is
probably to use "hg transplant" with the --filter option, and write a
script that sets the message you want. Then strip the offending
changeset(s).
eric
More information about the Mercurial
mailing list