[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Automatic pretty-print

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-08-18 21:04:06 CEST

On Wed, 2004-08-18 at 13:59, Zeus Gómez Marmolejo wrote:

> Well, the problem is there are a lot of programmers and I can not enforce to
> all of them to execute the pretty-printer before commiting. It must be done
> transparently to the programmer.

Says who? You can make your programmers use any tools you want. Why
does a formatting tool have to be transparent? That's a policy decision
that *you* get to make.

If the server rejects any commits of badly-formatted code, then that
will "force" them to learn to write well-formatted code, or "force" them
to use a tool that cleans up their code before committing. The
pre-commit hook can help you enforce the new policy.

> How can I run this transformation program before commiting, is there any way!?
> I think in the pre-commit hook I can not modify the transaction, but what
> happens if I do it??

If any hook script modifies the data, then the working copy and
repository disagree about what files look like. Everything will break.
You *cannot* have the server change data. All you can do is have the
server reject bad data.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Aug 18 21:07:00 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.