Line ending translation extension
Mads Kiilerich
mads at kiilerich.com
Mon Sep 7 08:22:55 CDT 2009
On 09/07/2009 02:13 PM, Douglas Philips wrote:
> In a DVCS, policy decisions (such a line endings) can only be enforced
> by hooks running on the repos wishing to enforce those policy
> decisions. Anyone who can clone your repo, can make changes: with
> funky line ending mixings, funky mixed character encodings, tabs and
> spaces, whatever they want. That is the point of a DVCS. It seems that
> what you want is to have a set of hooks on your "we care about these"
> repos that will reject any changesets that violate your style. As an
> example, NetBeans has a number of hooks to enforce their requirements:
> http://wiki.netbeans.org/HgHowTos#section-HgHowTos-ServerHooksAbortPretxnchangegroup.somethingHookFailed
> (or: http://bit.ly/bA3d0)
>
> You can even suggest that folks who clone your repo(s) set up commit
> hooks for their local repos, so as to catch the same issues that your
> shared repos will catch. This way when they try commit locally they'll
> be warned/prohibited and can fix their stylistic violations sooner
> rather than later.
>
I think the focus should be on making it easy to do the right thing and
help people to fix problems if they arise.
Hooks won't fix the problem. They will just escalate minor style
annoyances to showstoppers. That might be good in some setups with some
policies, but I would rather not work such a place where someone else
operates the clue stick.
/Mads
More information about the Mercurial
mailing list