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

Re: Pre-commit transaction modification question

From: Bruce Elrick <bruce_at_elrick.ca>
Date: 2004-02-12 01:13:43 CET

Given the warnings about the server-side pre-commit hook changing the
transaction causing WC badness, might I suggest you turn to using a
wrapper on the client side? Implement the format check in the
pre-commit hook as Ben suggested to prevent people from bypassing the
wrapper on the client side, but on the client side write a wrapper that
runs your formatter on appropriate files that are modified, then run svn
commit from inside the wrapper. You can determine how sophisticated the
wrapper has to be based on you user's trainability.

That's my naive suggestion.

Cheers...
Bruce

Brett Wooldridge wrote:

> Ok, arguments about merits aside (as we've been using this model under
> CVS for over a
> year without issue) -- I'd still like to know how to accomplish this
> under Subversion. CVS
> has the same 'issue', in that after checking in the source, the source
> in the repository no
> longer matches the source on the user's system. Again, for our
> organization, this has not
> been an issue -- the only side-effect being that an immediate diff will
> show the differences
> in formatting, but after an 'update', the work is right again. So,
> paternalism aside, can you
> please help me shoot myself in the foot? :-)
>
> bw
>
> Ben Collins-Sussman wrote:
>
>> On Wed, 2004-02-11 at 17:18, Brett Wooldridge wrote:
>>
>>
>>> Any help, pointers, and advice is appreciated.
>>>
>>
>>
>> DON'T DO IT.
>>
>> If the repository mangles the files as they enter the repository, then
>> your working copy will be completely wrong. The working copy will
>> think, "ah, this file I committed is what the latest version looks
>> like", but in reality, the latest version in the repository is very
>> different. There's no way for the pre-commit hook to tell the working
>> copy that it mangled the data.
>> What Subversion people have done instead is to install a pre-commit hook
>> which merely *validates* a style, and rejects the whole commit if any
>> file files to conform. This forces users to run the reformatter.
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 12 01:14:22 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.